Re: [flexcoders] Copying an Object

2008-04-24 Thread Peter Connolly
Take a look at the copy() method in ObjectUtil:

http://livedocs.adobe.com/flex/2/langref/mx/utils/ObjectUtil.html#copy()


[flexcoders] Copying an Object

2008-04-24 Thread Lisa Lee
I'm sort of a newbie to Flex/ActionScript...can someone tell me the 
best way to copy an object to a new variable?  For example, I have a 
variable named obj1, datatyped as Object.  Let's say that I've set 
obj1.property1 = "foo" and obj1.property2 = "bar."  Now I declare a 
variable named obj2, datatyped as Object.  I tried:  obj2 = obj1, but 
when I evaluate the variables at run time, obj2 evaluates to null.  Do 
I have to explicitly copy each property from obj1 to obj2, or is there 
a better/easier way to do this?  Hope that made sense.