Skip to main content
Participant
May 26, 2013
Question

AIR 3.7 Problem Loading Multiple Similar SWFs On iOS

  • May 26, 2013
  • 1 reply
  • 599 views

I'm running into an issue with loading multiple SWFs using AIR 3.7 on iOS. The exact same code works fine on Android.

The issue is that if I include 2 specific SWFs then neither of them will load correctly. When I include just one of the SWFs it works great. I've also tried including a second SWF which is pretty much empty and that also works. Additionally, I've been able to load a MovieClip out of the first SWF IF addChild() was first used on myswf1 and that works even when the main SWF did not. Lastly if I include 2 of the exact same SWFs (with different filenames) that also works.

So my question is what is it about the two SWFs that causes it not to work? They are effectively the same except each has custom assets and custom class naming.

Both of them subclass off one main class like this:

class myswf1 extends mymain

class mymain extends MovieClip

class myswf2 extends mymain

class mymain extends MovieClip

So both SWFs contain mymain seperately from each other. Could that be the issue? Like when it compiles all the code into the package SWF the

two mymain root classes clash?

In the past it seems like that should still work it just uses the first loaded class and that is it.

The errors that I get seem to happen on lines like this:

selectableHudOptions.bonustime.mouseEnabled = false;

Where selectableHudOptions.bonustime is basically null. However, when I just have 1 SWF this line works fine.  If I loop through selectableHudOptions's children it is blank when I am loading the two SWFs but it shows all of the children when just loading the one SWF.

Another theory I have about it is that it seems like addChild() has to be used on the objects and frames have to go by before the children are visible. Like addChild() is being delayed somehow because of the multiple SWFs. Or addChild() is behaving asyncronously and my code is running syncronously.

I think Nimisha from Adobe has worked on these multiple SWF issues before.

This topic has been closed for replies.

1 reply

Adobe Employee
May 27, 2013

Yes, duplicate symbol conflict looks like the cause of your issue.

This is a known issue in AOT mode. For now, could you please try renaming mymain to something else when using it in the second swf?

Or you may place mymain into separate swc, and link one of your swfs with "merged into code" option, while the other one "externally", so that only one of the swfs has mymain defined and there is no clash.

Please do let us know if either of the solutions work for you.

KrakrokAuthor
Participant
May 27, 2013

Well, I tried both of those ways. The app just exits when I try to load the SWF now. Works okay in the debug launcher.

Adobe Employee
May 28, 2013

That looks bad. Could you please log a bug at bugbase.adobe.com, along with your swfs / assets, etc to reproduce it.