[Flashcoders] compare Objects
Hello, seems trivialo, but is there a simpler way to compare two identically formed objects than recursively compare their props (and types and values of their props)? var obj1:Object = {a:0,b:1,c:[0,1,2],d:[{x:0,y:10},{x:10,y:0}]} var obj2:Object = {a:0,b:1,c:[0,1,2],d:[{x:0,y:10},{x:10,y:0}]} trace (obj1==obj2) returns false... Thanx, Gilles ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] compare Objects
It is more reasonable to include a method in the class to compare itself to another instance of itself. x= new myObj(1,2,3) y=new MyObj(1,2,4) trace (x.isequal(y)) Ron Gilles Roquefeuil wrote: Hello, seems trivialo, but is there a simpler way to compare two identically formed objects than recursively compare their props (and types and values of their props)? var obj1:Object = {a:0,b:1,c:[0,1,2],d:[{x:0,y:10},{x:10,y:0}]} var obj2:Object = {a:0,b:1,c:[0,1,2],d:[{x:0,y:10},{x:10,y:0}]} trace (obj1==obj2) returns false... Thanx, Gilles ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] compare Objects
Fix a small typo It is more reasonable to include a method in the class to compare itself to another instance of itself. x= new MyObj(1,2,3) y=new MyObj(1,2,4) trace (x.isequal(y)) Ron Gilles Roquefeuil wrote: Hello, seems trivialo, but is there a simpler way to compare two identically formed objects than recursively compare their props (and types and values of their props)? var obj1:Object = {a:0,b:1,c:[0,1,2],d:[{x:0,y:10},{x:10,y:0}]} var obj2:Object = {a:0,b:1,c:[0,1,2],d:[{x:0,y:10},{x:10,y:0}]} trace (obj1==obj2) returns false... Thanx, Gilles ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com