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 _global
for (thisObject in _global) {
trace(thisObject);
}
 | 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. |
Next: Looking at the Prototype Property >>
More Flash Articles
More By O'Reilly Media