Skip to main content
Participant
November 4, 2010
Answered

How to make nested Movie Clip Play Once, then stop?

  • November 4, 2010
  • 1 reply
  • 6491 views

Hello All,

I've been searching for a simple solution to this question for over a year now. I've seen a few solutions

that do not work, and many questions, that remain unanswered questions.  So I thought I'd get it from the pros. 

I have a nested movie clip (image sequence) that I use the code snippet from Flash CS5 to GoToAndPlay.  The Movie Clip

loops continuously.  How do I get it to play once and stop.  I've tried the snippet for GoToAndStop, I've tried

stop(); in my 'Actions' layer.  I've tried a stop(); in the last frame of my nested sequence.  I've tried a stop at the

end of the function but nothing stops the darn thing. It keeps going and going and going.  Here is my typical code that

loops....

stop();

btn3.addEventListener(MouseEvent.CLICK, cd_ClickToGoToAndPlayFromFrame);

function cd_ClickToGoToAndPlayFromFrame(event:MouseEvent):void

{

gotoAndPlay(1);

}

btn4.addEventListener(MouseEvent.CLICK, ef_ClickToGoToAndPlayFromFrame);

function ef_ClickToGoToAndPlayFromFrame(event:MouseEvent):void

{

gotoAndPlay(10);

}

There are two(2) buttons on the page, basically and back and forward button, and the image sequence is nested in a

movie clip in this case at frame (1) and another nested movie clip at frame (10).  How can I make it play once and stop

on the last frame of the nested clip?

Thanks,

Duane 

This topic has been closed for replies.
Correct answer

You are welcome.

If my answer has worked for

you, please mark your question as answered.

1 reply

November 4, 2010

Give the nested clips instance names:

for example : nested1

and put a stop(); to the last fame of the nested clips.

and where needed just write : nested1.gotoAndPlay(1);

Participant
November 4, 2010

Hakan,

Thank you very much! That worked 1st try. I've been bouncing between Flash and

Unity and Xcode and After EFX...and that has been a constant pain in the butt I

failed

to address. Thanks again.

Duane

Correct answer
November 4, 2010

You are welcome.

If my answer has worked for

you, please mark your question as answered.