views:

516

answers:

1

I appreciate loading AS2 into AS3 is never going to be fun, but unfortunately I have to on this one.

I'm using the Loader Class in AS3 to load an external AS2 SWF onto the stage as a AVM1Movie Object. Anything that is placed on the stage in the AS2 FLA displays fine, but no ActionScript runs at all.

The loaded AS2 SWF has one layer, one frame and a few images in the library but nothing heavy. I've tried stripping everything out of the script other than a simple call to change the text on a dynamic textfield on the stage - still nothing.

I have a listener in AS3 waiting for Event.INIT rather than Event.COMPLETE - but neither works.

Am I missing something? Anyone else experienced anything similar? It's like it loads but doesn't run.

A: 

AVM1 movieclip actionscript would not run by itself in AVM2 enironment. You will have to wrtie a wrapper for the same using LocalConnection.

check out an example here http://www.actionscript.org/forums/showthread.php3?t=116805

jash
Thanks Jash, but I'm not trying to communicate with the AS2 SWF - I just want it to load and do exactly what it does as a standalone SWF. After stripping everything out, there is now only one line of script on the first and only frame:textOnStage.text = "hello";Any GFX on the stage displays fine, it simply won't run ANY script.
steve
okai! In that case the following code should perfecly work, with as2.swf having simple textOnStage.text = "hello" script in it. Just check if you are doing the same.var req:URLRequest = new URLRequest("as2.swf");var loader:Loader = new Loader();loader.load(req);addChild(loader);
jash
Yep - I'm doing that. addChild(loader) rather than addChild(loader.content) - the only way it adds AV1 to stage. As I said, it works in as far as it loads all STATIC graphics which display fine - but no script will run.
steve