describeTypeJSON function is faster than the XML-based
describeType function by default, but we can make it even faster. Today’s article describe just how this is done and achieves a nearly 10x speedup!
Posts Tagged describeType
flash.utils.describeType has been around since Flash 9 and is the standard way to find out interesting information about a
Class type, including its metadata/annotations. However, there’s a hidden function called
describeTypeJSON that provides an interesting alternative. Since
describeType is notoriously slow, could
describeTypeJSON be the speedy alternative we’ve been looking for? Today’s article puts them to the test!
If you’re thinking “I know what an
int is”, you need to take this little quiz to find out for sure!
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-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