I'm trying to JSON encode and decode a flash.geom.Rectange object. When I decode the object, it is of type Object. If I try to cast it to Rectangle, I get a null object:
var rect:Rectangle = JSON.decode(json_string) as Rectangle;
It looks like I can't cast to a Rectangle from Object that has exactly same properties as Rectangle.
An option would be to copy properties from Object to Rectangle.
I'm looking at introspection of objects however, iterating through object's properties only goes one level deep. If an a property that is being copied is of type Point, the Point's properties are not copied. Looks like I have to copy them recursively.
Is there a function in actionscript that would deep copy an object?