Skip to main content
Inspiring
October 9, 2013
Question

Problem to play mc at frame 1

  • October 9, 2013
  • 1 reply
  • 971 views

Hi!

on the main stage I have 2 clips 'mc' and 'bttn'. inside 'bttn' there is a button located at frame 356.

when it click it call a function to load an external clip into root into 'mc'.

external clip runs after click the button but it doesn't starts at frame 1, but rather it already stop at the end frame.

I tried several things like  mc.gotoAndPlay(1); etc, but nothing work it just always starts from the end frame.

I think it has to do that button is located at frame 356 and the external clip only has 30 frames so by the time button is clicked it's already far away from where external clip stops

but how do i fix this?

thank  you

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
October 9, 2013

attach a stop() to frame 1 of your external clip.  after loading is complete, execute a play().

Inspiring
October 9, 2013

I tried that, put a stop() on frame 1, and then in the main stage I have these

var appRequest:URLRequest = new URLRequest("001_createapp.swf");    //external clip

var appLoader:Loader = new Loader();

 

appLoader.load(appRequest);

newAcc.addEventListener (MouseEvent.CLICK, signInFunc);

function signInFunc (e:MouseEvent):void {

 

          MovieClip(parent.parent.parent.parent).subMc.removeChildAt(0);

          MovieClip(parent.parent.parent.parent).subMc.addChild(appLoader);

          MovieClip(parent.parent.parent.parent).subMc.gotoAndPlay(1);      //subMc the main mc clip go to

          MovieClip(parent.parent.parent.parent).mainMc.removeChildAt(0);

          MovieClip(parent.parent.parent.parent).mainMc.removeChildAt(0);

          MovieClip(parent.parent.parent.parent).mainMc.removeChildAt(0);

          MovieClip(parent.parent.parent.parent).prodInfo.removeChildAt(0);

          MovieClip(parent.parent.parent.parent).prodInfo.removeChildAt(0);

}

it still stops at frame 1 and thats it

kglad
Community Expert
Community Expert
October 9, 2013

if 001_createapp is the movieclip stopped at frame 1:

var appRequest:URLRequest = new URLRequest("001_createapp.swf");    //external clip

var appLoader:Loader = new Loader();

appLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadcompleteF);

appLoader.load(appRequest);

function loadcompleteF(e:Event):void{

MovieClip(appLoader.content).play()

}