Skip to main content
Participant
December 12, 2012
Question

Loading multiple swfs using air 3.6 for ios

  • December 12, 2012
  • 2 replies
  • 14269 views

Adobe, can you please provide us with the code to load multiple swf files for ios. Please provide examples. The code below loads multiple swfs, but the swfs stall, so this does not seem to be a solution.

Code description: A flash file made up of 4 frames with forward and back buttons that navigate from frame to frame. The code loads three different swf files in frames 2, 3 and 4.


Frame 1:

var myLoader:Loader;

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

if(myLoader == null){myLoader = new Loader(); addChild(myLoader); }

else {myLoader.unload();}

Frame 2:

  1. myLoader.unload();
  2. myLoader.load(new URLRequest("file1.swf"),loaderContext);

Frame 3:

  1. myLoader.unload();
  2. myLoader.load(new URLRequest("file2.swf"),loaderContext);

Frame 4:

  1. myLoader.unload();
  2. myLoader.load(new URLRequest("file3.swf"),loaderContext);

This topic has been closed for replies.

2 replies

Nimisha1
Participating Frequently
December 12, 2012

Hi Conner,

On iOS the method "unload" doesn't work (is no-op) and therefore in your app the same loader is loading all the swfs. Can you please share a sample app(with sources) of your project with me @nimisha1@adobe.com so that I can reproduce the issue locally?

Thanks,

Nimisha

Participant
December 29, 2012

I downloaded AIR SDK 3.6 beta and overlay it in FlashBuilder 4.7.

I export release build with some swf files, which included in package content.

When application started i am trying to load swf file like written in this article.

Unfortunately, it result to 'Uncompiled ActionScript' error.

Please tell me, could i load and get access to external swf with action script at runtime?

Are there any special requirements for compiling external swf?

Thanks.

Nimisha1
Participating Frequently
January 2, 2013

Are you using swf-version=19? Also are you packaging secondary SWF with the root SWF?