mensonge
mensonge

Reputation: 81

Flex: How do you list private attributes of a class?

I try to serialize objects with their private attributes, in Flex.

The introspection API does not seem to allow it: "The describeType() method returns only public members. The method does not return private members of the caller's superclass or any other class where the caller is not an instance."

Is there another way for an instance to know the name of its private members?

Upvotes: 4

Views: 919

Answers (1)

Andrew Aylett
Andrew Aylett

Reputation: 40720

Unfortunately, the describeType() method is the only way to do introspection in Flex. People have written wrappers around it, and if you want to do introspection then I'd recommend as3-commons-reflection, but there is no way to list the private attributes of a class and no way to access them even if you could list them.

Upvotes: 3

Related Questions