Skip to main content
Participant
July 30, 2013
Question

Secondary loaded SWF is freezing on iOS

  • July 30, 2013
  • 1 reply
  • 879 views

Good day, guys! I have encountered some strange bug with my app. The architecture is simple: I have a wrapper (preloader) that loads main swf and display it. It's work really fine on my device (iPod 5) in ipa-test-interpreter mode. But when I package it for App Store and send on review it have been rejected (many times already) with reason, that app freezes on startup.

I've thought about this problem and tried to package app in ipa-test. And.. It's really freeze on startup!

I think the problem is in multiple SWF or something like that.

Here are some code:

private function init():void
  {
swfLoader = new Loader();  
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, mainSwfLoaded); 
swfLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, IOLoadingError);   
swfLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, SecurityLoadingError);     
    swfLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);  
var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);    
swfLoader.load(new URLRequest('external_swf/main.swf'), loaderContext);    
     }        
     private function mainSwfLoaded(e:Event):void       
    {       
swfLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, mainSwfLoaded);      
swfLoader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, IOLoadingError);   
swfLoader.contentLoaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, SecurityLoadingError);   
   swfLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, onProgress);         
addChild(swfLoader.content);  
}

I'm using Adobe AIR SDK 3.7 and FlashDevelop. What it's can be? Some restrictions to load external swf? Both of my SWF's are package in the same ipa.

This topic has been closed for replies.

1 reply

Adobe Employee
July 30, 2013

Could you please try with AIR 3.8.

Also, could you check if there are classes with same names (package + class name) both in the preloader and main.swf. There is a known issue during swf loading, if the symbols (classes) conflict.

Though, it would be great if you could log a bug at bugbase.adobe.com with your app xml, swfs and packaging command.

Participant
July 31, 2013

During the discovering this problem i found something really strange. How I already say'd in my app I use two SWF: one is main swf which contains all of the application logic. And the other one is just a preloader which simply loaded the first one.

In the main swf I have a singleton class which architecture is look like:

public function LanguageManager(caller : Function = null)

{

if (caller != LanguageManager.getInstance)

throw new Error("Singleton is a singleton class, use getInstance() instead");

if (LanguageManager._singleton != null)

throw new Error("Only one Singleton instance should be instantiated");

}

public static function getInstance():LanguageManager

{

if (_singleton == null)

_singleton = new LanguageManager(arguments.callee);

return _singleton;

}

So, this is working when compile it at 'fast-test' or 'fast-debug', BUT. When i compile it in slow modes (slow-test, slow-debug) it's crashes. When the Singleton is initializing for the first time it's throw the exception. I really don't know how this could be, but the solution is simple and genius - I'm just use the other singleton patter and it works.

Yeap, the issue is really there, but the problem is not in secondary SWF or something like that. Thank's for you attention, think this can be solved