Is there any way to find out what methods get called when moving the mouse over an object in a Flash project?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
So far @rvmook’s partial solution is the closest from my point of view. It would help if you use DisplayObjectContainer’s getObjectsUnderPoint() method to get a list of display objects you roll over, then loop through them and check which one has rollover/mouseover event handlers, then continue drilling down.
So one short solution would be:
Note! getObjectsUnderPoint() works if the loading swf has permissions from the domain hosting the loaded swf. One way to find areInaccessibleObjectsUnderPoint() method. If you own the loaded swf there shouldn’t be any problems. Otherwise you either need a crossdomain.xml on the domain hosting the loaded swf granting the loader swf’s domain access (and the loader swf should pass
new LoaderContext(true)as the second parameter for load() method of the Loader intance) or use a server side script in the language of your choice to proxy/copy over the loaded swf first.Here’s a basic example of what I mean:
This should do if you only need to find out the name of the method.
If you need further information, you could access the loaded swf’s bytearray and parse the actionscript bytecode to get information. I must admit binary and assembly are a bit out of my reach, but luckily there some great libraries out there to decompile swf files at runtime in as3. AS3SWF is a brilliant one, but does not deal much with actionscript tags, while as3commons is a great collection of libraries the specialize on the code aspect.
Here is an adaptation of the previous example that uses the as3-commons libraries(bytecode,lang,logging and reflect) to display the method signature and body(as AVM2 instructions):
For documentation purposes here’s the code for the SWF I loaded:
and here is a sample of the method detail trace using the getMethodDetails in my AdvancedInfo example:
For more information on the AVM2 instructions visit the documentation or the SWF File format specs (PDF link).
Other options that involve 3rd party software which I haven’t fully explored would be:
running, maybe I didn’t setup correctly.
HTH