Home arrow Flash arrow Page 3 - Undocumented ActionScript Flash Hack
FLASH

Undocumented ActionScript Flash Hack


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.)

Author Info:
By: O'Reilly Media
Rating: 5 stars5 stars5 stars5 stars5 stars / 28
September 27, 2004
TABLE OF CONTENTS:
  1. · Undocumented ActionScript Flash Hack
  2. · ASSetPropFlags( )
  3. · Looking at the Prototype Property
  4. · Trace() Statements

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
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:

String
fromCharCode
_ _proto_ _ 
constructor
prototype
substr
split
substring
slice
lastIndexOf
indexOf
concat
charCodeAt
charAt
toLowerCase
toUpperCase
toString
valueOf
_ _proto_ _ 
constructor

Note that this lists class methods and class properties followed by instance methods and instance properties indented under theprototype property.

 

Buy the book!If you've enjoyed what you've seen here, or to get more information, click on the "Buy the book!" graphic. Pick up a copy today!

Visit the O'Reilly Network http://www.oreillynet.com for more online content.


blog comments powered by Disqus
FLASH ARTICLES

- More Top Flash Game Tutorials
- Top Flash Game Tutorials
- Best Flash Photo Gallery Tutorials
- The Top Flash Tutorials for Menus
- 7 Great Flash Tutorials
- Adobe Creative Suite 5.5 Now Available
- Critical Flash Vulnerability Heats Up the Web
- More on Nonpersistent Client-Side Remote Sha...
- Nonpersistent Client-Side Remote Shared Obje...
- Using the Decorator Pattern for a Real Web S...
- Using Concrete Decorator Classes
- Delving More Deeply into the Decorator Patte...
- The Decorator Pattern in Action
- A Simple Decorator Pattern Example
- Decorator Pattern

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 4 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials