Everyone likes knowing about undocumented ActionScript. Discover the goodies in the _global property that Macromedia isn’t ready to officially support. (From the book, Flash Hacks, by Sham Bhangal, O'Reilly Media, 2004, ISBN: 0596006454.)
Undocumented ActionScript Flash Hack - Looking at the Prototype Property (Page 3 of 4 )
To see if there is anything interesting within the classes, we can look at each property of the classes in turn. If we hit upon theprototypeproperty — where methods and properties are stored for the class (whether using ActionScript 1.0 or 2.0) — looking at its properties and methods should reveal whatever interesting tidbits lurk there:
// Set protection flags to 110 for _global to unhide everything ASSetPropFlags(_global, null, 6, 1); // List all objects in _global for (thisObject in _global) { ASSetPropFlags(_global[thisObject], null, 6, 1); trace("\n" + thisObject); for (props in _global[thisObject]) { trace(" " + props); // List subitems found under prototype. if (props == "prototype") { ASSetPropFlags(_global[thisObject].prototype, null, 6, 1); for (protoChain in _global[thisObject].prototype) { trace(" " + protoChain); } } } }
If you attach the preceding code to frame 1 and test the movie in Flash MX 2004, you’ll see a lengthy display (which would stretch 10 pages in this book). The listing includes documented classes and their methods and properties, such as for the String class: