0

I recently found out that the flash swf's I was trying to load were in as2 which is causing a great deal of problems. The sad reality is I need to load these up somehow, or find some alternative.

What are my options for loading as2 into as3 from a remote source (different domain). I'm using Flashbuilder 4.5 as my development tool. I've been using flex for about two weeks now, so this is a little daunting...

Thanks

chobo
  • 31,561
  • 38
  • 123
  • 191
  • You should expand on what "causing a great deal of problems" means. I could be compile time errors, it could be run time errors, it could be communication between the two SWFs. It could be cross domain issues. I don't want to guess what your problem is and what the solution is. – JeffryHouser Jul 08 '11 at 01:41
  • Are you wanting the two to talk to each other or just be visible? – Nate Jul 08 '11 at 01:55
  • 1
    Chobo, I already answered this for you on the other question. Stop spamming. Voting to close. – J_A_X Jul 08 '11 at 14:14
  • possible duplicate of [Why isn't the swfloader working?](http://stackoverflow.com/questions/6602584/why-isnt-the-swfloader-working) – J_A_X Jul 08 '11 at 14:14
  • J_A_X all you said was the swf I am using is crap, you didn't provide any solutions on actually loading an as2 in as3 that work. – chobo Jul 08 '11 at 15:54
  • @Flextras - read the question. – chobo Jul 08 '11 at 15:56
  • @Nate - For now I just want it to be visible. – chobo Jul 08 '11 at 15:56
  • Try loading an alternate file, if it does than jax is correct as in the other question - incompatible as2 file. +1 jax – Nate Jul 08 '11 at 16:07
  • I'm with @J_A_X on this one and voted to close; as it seems to ask the same question as the previous one. – JeffryHouser Jul 08 '11 at 16:39
  • @Chobo, what part of "the swf is loading, but the code within the swf is faulty" don't you understand? Having it display *is not* a problem with Flex, it's a problem with the swf you're trying to display. – J_A_X Jul 08 '11 at 16:44

4 Answers4

1

The flash player has two different virtual machines for playing AS2 and AS3 content, but they can both work at once - in general, AS2 movies should play normally even when loaded into an AS3 parent.

So the answer to your question is, loading AS2 into AS3 isn't your problem, and you'll need to find out what is. Perhaps you're loading in the child but not adding it to the stage, or perhaps the child movie is made such that it waits for a function call before displaying anything? Those are just random guesses, all I can say confidently is that you have a bug somewhere you're not aware of.

fenomas
  • 11,131
  • 2
  • 33
  • 57
  • Close enough. The flash I was trying to load remotely was in turn loading additional swf files, so I guess the communication to these additional swf's was causing problems. – chobo Jul 22 '11 at 23:15
0

Use a SWFLoader?

More docs here.

JeffryHouser
  • 39,401
  • 4
  • 38
  • 59
0

This came up recently, see here: Load AS2 SWF Into AS3 SWF and pass vars in URL

Community
  • 1
  • 1
shanethehat
  • 15,460
  • 11
  • 57
  • 87
0

heres the code:" im sick of people just giving worthless inputs to problems, i think or maybe's or here is a link to go somewhere else bla bla bla (SOLVED)!

var swfLoader:Loader = new Loader();
stage.addChild(swfLoader);
var whatEver:URLRequest = new URLRequest("your_AS2_AS3.swf");
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
swfLoader.load(whatEver);
function loadComplete(e:Event):void {
trace("file loaded");

}

I have used this many of times with no problems,please note when you load an out side SWF file, That movies frame rate is the same as the parent Movie/Main movies frame rate. For detailed info on this class check adobe website Docs.

joshua
  • 676
  • 1
  • 5
  • 19