Skip to main content
Participating Frequently
March 20, 2013
Question

AIR 3.6 & 3.7 Loading Remote SWF Crashes iOS on Property Read

  • March 20, 2013
  • 1 reply
  • 2192 views

I have been trying out the feature in AIR SDK 3.6 that allows you to load local swf files with ABC.  This is working fine.  However, I am getting a crash on an iOS AOT build when I load a remote swf that does NOT have ABC and I try to read any property on that remote asset.  I have never had this problem with AIR 3.4.  The problem persists on AIR 3.7

Below is a simple example to reproduce the problem.  The crash will occur immediately when it attempts to trace the "currentLabels" property of the loaded content.  I believe the property itself to be arbitrary --- the same crash will occur when reading any property.  In fact, you can even set a breakpoint before that line and in the Flash Builder debugger, if you try to expand the content's properties the app will crash.

package

{

          import flash.display.Loader;

          import flash.display.MovieClip;

          import flash.display.Sprite;

          import flash.display.StageAlign;

          import flash.display.StageScaleMode;

          import flash.events.Event;

          import flash.events.ProgressEvent;

          import flash.net.URLRequest;

          import flash.system.ApplicationDomain;

          import flash.system.LoaderContext;

          public class MobileAppTest extends Sprite

          {

  private const path:String = "https://s3.amazonaws.com/wowzers-dev/mobile/client/";

                    private var files:Array = ["art/common/LoadingScreen.swf"];

                    public function MobileAppTest()

                    {

                              super();

                              stage.align = StageAlign.TOP_LEFT;

                              stage.scaleMode = StageScaleMode.NO_SCALE;

                              loadNext();

                    }

                    private function loadNext():void {

                              var loader:Loader = new Loader();

                              var req:URLRequest = new URLRequest(path + files[0]);

  trace("\n>>> loading: " + req.url);

                              loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onLoadProgress);

                              loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);

                              var context:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);

                              loader.load(req, context);

                    }

                    private function onLoadProgress(evt:ProgressEvent):void {

                              trace(evt.bytesLoaded + " out of " + evt.bytesTotal);

                    }

                    private function onLoadComplete(evt:Event):void {

                              trace("<<< onLoadComplete " + evt.currentTarget.contentType);

                              trace("=== currentLabels: " + evt.currentTarget.content.currentLabels);

                    }

          }

}

Am I doing something wrong?  Is this a known issue that will be fixed?

So far I have tested this on an iPad 3 with iOS 6.1.3.

Thank you.

This topic has been closed for replies.

1 reply

scottobotAuthor
Participating Frequently
March 21, 2013

I can submit this to the bug base.  I just wanted someone to confirm that it was an actual bug vs. something intentional.  It's pretty much a showstopper for my project as we load remote pure asset SWFs frequently and need the ability to read their properties.

scottobotAuthor
Participating Frequently
March 21, 2013

I just tried the very latest AIR 3.7 SDK (March 20th) and the crash did not occur!  I will report any new developments.

chris.campbell
Legend
March 21, 2013

Good to hear.  Please let us know if you encounter any problems with the 3.7 beta.

Chris