all groups > flash actionscript > november 2006 >
You're in the

flash actionscript

group:

Object methods and properties



Object methods and properties crispymuscat
11/23/2006 8:55:05 PM
flash actionscript: :confused; just begininng OOP ---so pls excuse stupid ?

Would appreciate it, if anyone could explain in plain english, why when my
custom class is extended, and i loop through the object properties from within
the fla, only the private properties are listed. How come the methods of the
custome class are not listed in the loop, in fact how do u list the methods
from any class from a loop. I cant get my head around this one. Does the
answer lie in the interface concept??,
much appreciated
Re: Object methods and properties LuigiL
11/23/2006 9:57:16 PM
According to the ECMAScript 4 specs, instance properties should remain
non-numerable even after value assignment. But in ActionScript 2 an instance
property becomes enumerable after it is assigned a value (unless the value
assignment is part of the property declaration). This might change as
ActionScript evolves.
Class properties - declared as static - are enumerable with a for-in loop. And
dynamic properties are enumerable.
ActionScript 2 doesn't support the ECMAScript 4 enumerable attribute but you
can use the undocumented ASSetPropFlags() function (Google -> ASSetPropFlags).
In short: just (almost) following the standard.
AddThis Social Bookmark Button