Home arrow Flash arrow Page 2 - 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 - ASSetPropFlags( )
(Page 2 of 4 )

ASSetPropFlags( ) takes the following form:

ASSetPropFlags(object, properties, setTrue, setFalse)

where:

object

Is the object or scope that you want to examine.

properties

Is the properties/methods ofobject for which you want to change the protection flags. You also have the option of settingproperties tonull, which acts as a wildcard that means “all properties.”

setTrue

Is an integer bitmask specifying the configuration flags. The last 3 bits of this integer are the important ones and represent (rightmost bit to leftmost) the “protect from overwrite,” “protect from deletion,” and “hide” flags. For example, settingsetTrue to 110 binary (06 in hex or 6 in decimal) keeps them protected from overwrite and deletion but unhides the properties specified byproperties.

setFalse

Is another integer bitmask that works likesetTrue, except it sets the attributes to false. ThesetFalse bitmask is applied beforesetTrue is applied.

The FlashCoders Wiki (http://chattyfig.figleaf.com/flashcoders-wiki/ ?ASSetPropFlags) includes a chart describing various bitmasks used with ASSetPropFlags( ).

The properties/methods we want to make visible are those of the_globalscope, which contains all the built-in ActionScript classes. We can thus make the entire set of classes within ActionScript enumerable via a for...in loop:

ASSetPropFlags(_global, null, 6, 1);

The following code unhides all of ActionScript and then looks to see what classes it can find:

// Set protection flags to 110 for _global to unhide everything ASSetPropFlags(_global, null, 6, 1);
// List all objects in _globa
l
for (thisObject in _global) {
trace(thisObject);
}

 

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 11 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials