In my last article on getProperties, there was one strange finding in the tests of standard classes: the Function
class seems to have a length
field. What is it? Today we’ll see
Posts Tagged field
Quite often I have wanted to iterate over the public fields (and getters) of an arbitrary object. Sometimes this is for debugging purposes so I can print out the state of an object, particularly one that has all public fields like a C/C++ structure. Sadly, this is not possibly (with most objects) using the for-in
and for-each
loops we’ve come to know and love. So I made a utility function that I’m sharing with you all today. UPDATE: getProperties now supports MovieClip
derivatives such as library symbols from an FLA
Being allowed to declare and define member variables all at once introduces a question: in which order does the class boot up? Further, if the class has parent classes, how does this change things? Read on for the simple results.
AS3 makes some strange things possible. Even stranger, it seems to do this without any warning by its compiler: MXMLC. It seems as though one of these strange things is the ability to override the variables of your parent classes.