R – Loading symbols from an AS2 SWF into an AS3 application

actionscriptactionscript-2actionscript-3flash

I am converting a large application from AS2 to AS3. Part of the function is that it loads assets embedded in SWFs, which are old things. It is not possible to convert these to AS3 (there's really no code in them, it's just they're produced by tools that output flash 6 compatible SWFs).

The question is, how can I use this AVM1 (ActionScript VirtalMachine 1) graphical content inside an AVM2 application?

Here's what I used to do in AS2:

mcLoader = new MovieClipLoader();
mcLoader.addListener(this);
holder = createEmptyMovieClip('holder', 10);
mcLoader.loadClip("http://.../library.swf", holder);
function onLoadInit() {
  holder.attachMovie('GFXsymbolInsideLibraryswf', 'mysymbol', 123);
}

How can I do the same thing in AS3, loading the AS2 library swf? Am I going to need another layer of a 'wrapper' SWF that communicates via LocalConnection? Please tell me there's an easier way. Can I flip the bits on Library.swf to force it to load as an AVM2 SWF? Since there is no code inside it, maybe that would work?

Best Answer

You're probably best of by loading your legacy swf into an AVM1Movie object in AS3.

Related Topic