Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Controlling loaded swf from main timeline

New Here ,
Jun 19, 2013 Jun 19, 2013

Hello,

I'm working on loading external swf files for ios. I am able to load the swf files and set them to visible or invisible in different frames. I am having trouble controlling the loaded swf files from the main timeline. Specifically, I would like to have a button on the main timeline, that when clicked will move a loaded swf to frame 1.

Here is a code that loads one swf file:

var myLoader1:Loader;

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

if(myLoader1 == null)

{

          myLoader1 = new Loader();

          addChild(myLoader1);

}

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

myLoader1.visible = true;

backbutton.addEventListener(MouseEvent.MOUSE_DOWN, backbutton1);

function backbutton1(myEvent:MouseEvent):void {???????????? myLoader1.gotoAndStop(1);}  (this line does not work)

(Once I load file1.swf, within the file1.swf I click a forward button to move to different frames. My question is: how do I code the 'backbutton' on the main timeline so that it causes the loaded file1.swf to go to frame 1?)

Thank you for your help.

TOPICS
ActionScript
970
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 19, 2013 Jun 19, 2013

after loading is complete (and assuming you're loading an as3 swf), you can use:

MovieClip(myLoader1.content).gotoAndStop(1);

Translate
Community Expert ,
Jun 19, 2013 Jun 19, 2013

after loading is complete (and assuming you're loading an as3 swf), you can use:

MovieClip(myLoader1.content).gotoAndStop(1);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 19, 2013 Jun 19, 2013

Perfect. Thank you for your help.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 19, 2013 Jun 19, 2013

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 19, 2013 Jun 19, 2013

I'm just wondering, would it be possible to control a movieclip that is inside the loaded swf? For example, if the loaded swf had three movieclips on the first frame, can you have a button on the main timeline that can set the three movieclips to their frame1?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 19, 2013 Jun 19, 2013

sure.

if the movieclip on the loaded swf's main timeline has reference mc, you would use:

MovieClip(myLoader.content).mc.gotoAndStop(1);

p.s.  you might find the following helpful,  http://kb2.adobe.com/community/publishing/918/cpsid_91887.html

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 19, 2013 Jun 19, 2013

Fantastic. Thanks again.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 19, 2013 Jun 19, 2013
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines