1 Reply Latest reply on Nov 23, 2006 1:57 PM by Peter Lorent

    Object methods and properties

    crispymuscat
      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
        • 1. Re: Object methods and properties
          Peter Lorent Level 2
          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.