ASnative( ) Back Door #83
Chapter 10, ActionScript
class (although more likely a custom subclass of the XML class). Test it in
Flash MX 2004 to see the properties it displays.
Cookie.setCookie("footest data");
result = Cookie.getCookie( );
trace (typeof result);
trace (result instanceof XML);
for (props in result) {
trace (props);
Decoding the XML structure to recover the original text (“footest data”)
specified in the original setCookie( ) call, is left as an exercise for the reader.
Happy hunting!
Final Thoughts
Of course, undocumented features of the Flash Player are undocumented
and unsupported for a reason. They may be beta features that don’t work
properly or haven’t been thoroughly tested. There is no guarantee that
undocumented features will be present in future versions of the Flash Player,
so use them with caution. Even if it works on one browser and platform, it
might not work on all of them.
ASnative( ) Back Door Hack #83
All ActionScript method calls are mapped to a table of internal functions built
into the Flash Player. Directly access the internal function table via the
undocumented ASnative( ) method.
The Flash Player supports methods that are not exposed in the ActionScript
API. That is, not only are some functions undocumented, they don’t even
have names! Instead, they are stored in a function table and accessed by
indexing into that table.
The undocumented ASnative( ) function can access internal ActionScript
methods, including those not findable using ASSetPropFlags( )
[Hack #82].It
appears to access functions in a lookup table by using two indexes:
ASnative(a, b);
or, in some cases, an optional argument list:
ASnative(a, b)(args);
where index a is an integer correlated to an ActionScript class, index b is an
integer correlated to a method within the class, and
args is one or more
argument(s) associated with the method.

Get Flash Hacks now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.