views:

372

answers:

4

I've been trying very hard to get an AS2 swf to load properly inside an AS3 swf - but to no avail ...

The AS2 file (which is a rather big app referencing many external xml files etc.) works perfectly when launched in Flash Player.

When trying to load the same file through an AS3 swf (using URLRequest and Loader classes), the file starts loading but stops abruptly during the preloading phase. (Same happens if I try to load it using AS2 "loadMovie".)

Update: It seems as if the swf actually loads through AS2 loadMovie but not AS3 Loader class.

What is there more to try? Security settings, custom loader classes - any advice is appreciated.

+1  A: 

In general your loaded movie have to be designed to be loaded from an other swf. For example any initialization code must be places after the Event.ADDED_TO_STAGE event occurs and every references to the root don't work as you expect. For example the root for an element it's the stage when the swf runs alone but when the swf it's loaded from another swf the root it's the parent swf that can be different in size and position causing you some trouble.

wezzy
There's no Event.ADDED_TO_STAGE in AS2, which is what the child SWF he is loading is written in.
davr
+2  A: 

Also keep in mind that an AS2 swf loaded into an AS3 swf will have problems communicating to it's parent swf, so the Loader will have trouble keeping track of the loading of the swf - so that might cause you a problem. You should build the swf that DOES the loading in AS2 and then connect it to an AS3 swf using LocalConnection.

Hudey
A: 

In your AS2 code, be sure to set lockroot (or was it _lockroot?) to true. Also if you use _level0 in your AS2 code anywhere, it will not work, you need to change that to _root.

davr
A: 

check this one.

  1. make an AS2 container to load your AS2 APP, in frame2;
  2. load container to AS3 animation.
  3. make these communications via LocalConnection.

or

export all your AS2 APP classes to frame 2 (in publish setting).

shams