Friday, March 27, 2009

Why are my ValueObject member variables undefined in the results from my RemoteObject requests

Question :Why are my ValueObject member variables undefined in the results from my RemoteObject requests?
Answer :Flash Player deserializes objects in a special order that can confuse developers used to object
serialization from other RPC systems. When a strongly typed object is returned to the player, it first
creates an instance from the prototype of the registered class without calling the constructor. It then
populates the object with the properties sent in the result. Finally, it calls the constructor without
arguments.
If your ValueObject constructor expects arguments to initialize an instance, be sure to check whether
arguments were actually sent to the constructor before overriding member variable values.

No comments: