I have a windows form application that "plays" an Flash SWF file. I am seeing random Method: FlashMethodInvocation Exception: System.AccessViolationException errors. The output only gives me the stack trace of the windows form application, not the actionscript, where I believe the real error is occurring.
I have the source code the swf as well, its all written in ActionScript 3 and I use flashbuilder to create it.
The windows form application is written in C#. The windows form application creates an instance of the ShockWave ActiveX control which is then told to load the swf. There is interaction between the SWF and C# code through the external interface provided in actionscript.
The SWF actionscript plays fine for hours before the crash. Unfortunately, the actionscript stack trace is not included in the error when it bubbles up to the windows form application.
I would like to see what is happening in the actionscript at the time of the exception. Any ideas how I can find the actionscript stack trace?
Matt
I was once in a situation similar to yours, and I remember having resolved it by replacing the "regular" Flash Player with its "debuger" version. You say you are using the ActiveX version of the player, so
1) first download this file:
Flash Player content debugger for Internet Explorer - ActiveX
2) Install it, then navigate to: "c:\Windows\SysWOW64\Macromed\Flash\", there you should find a file named something like "FlashUtil*_ActiveX.dll", which was just freshly replaced (check the file's date). This is the debugger version of the Flash player you just installed.
3) Overwrite this file in your windows form application (I assume you included the Flash Player in the application, rather than relying on the player being available on the host system, which I wouldn't recommend).
4) Then, in your ActionScript project (in Flash Builder) create a debugger version of your SWF (just launch the project in "Debug Mode", and copy the resulting SWF file in your windows form application.
5) Keeping the debugger running in FlashBuilder, interract with your windows form application until it produces the RTE. You should see the trace of the ActionScript error in Flash Builder. Of course, you can set breakpoints in Flash Builder and debug as usual.
You may want to use a form of automation that repeats the whole process (I'm thinking of ANT or the Flash Builder's Externals Tools (is that the right name?) — you could even have your windows application automatically launched by FB, after it first creates a new SWF file and places it in the right folder).
Hope this was clear enough.
Good luck!