Skip to main content
Participant
May 11, 2013
Question

Loading multiple swfs for ios - reloading issue

  • May 11, 2013
  • 1 reply
  • 1002 views

Hello,

I'm working on loading multiple swf files for ios. This is what I have done so far (note that I am AS3 beginner).

I have loaded all of the swf files on the first frame of the main.swf, and set them all to invisible. In subsequent frames I have changed the loaded swf files to visible and then again to invisible.

I have added the main code below.  You can download all of the fla files from: https://www.dropbox.com/s/swbkjundbmizu1n/Adobe.rar

My question is, how do I set it so that every time I move from one loaded swf file to another, all of the swf files are sent to their frame 1. For example, let's say I am viewing swf file #1.  The swf file contains buttons that allow me to proceed through the swf file. When I reach the end of the file, I click to view another swf file, say swf file #2. When swf file #2 appears, swf #1 file is reset to invisible. I would like it that not only is it set to invisible, but is also returned to its frame #1. If I do not set file #1 to frame 1, then when I return to view file #1, it will still in the last place I viewed it, in this case at the end of the file.

Basically, what code do I add to the parent file, so that all loaded files are at their frame 1? More specifically, what code could I add to a button to cause a loaded file to move to frame 1?

Here is the most of the code:

Frame 1:

var myLoader1:Loader;

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

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

var myLoader2:Loader;

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

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

var myLoader3:Loader;

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

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

myLoader1.load(new URLRequest("folder/file1.swf"),loaderContext1);

myLoader2.load(new URLRequest("folder/file2.swf"),loaderContext2);

myLoader3.load(new URLRequest("folder/file3.swf"),loaderContext3);

myLoader1.visible = false;

myLoader2.visible = false;

myLoader3.visible = false;

Frame 2:

a menu for the three files

Frame 3:

myLoader1.visible = true; myLoader2.visible = false; myLoader3.visible = false;

Frame 4:

myLoader1.visible = false; myLoader2.visible = true; myLoader3.visible = false;

Frame 5:

myLoader1.visible = false; myLoader2.visible = false; myLoader3.visible = true;

This topic has been closed for replies.

1 reply

Participating Frequently
May 21, 2013

This is AS3 specific question, not particular to Adobe Air 3.8 Beta.