homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

gotoAndPlay(5) doesn't refresh clip in frame 5

5+ Year Member

Msg#: 3401350 posted 4:24 pm on Jul 22, 2007 (gmt 0)


I assume the problem is trivial but I'm learning so please excuse if level of the question... :)

I have a very simple situation:

two layers and 10 frames in all

Layer1 contains a button that when released triggers the following action:


the button is present in all 10 frames.

Layer2 has a movie clip in frame 5 that continues up to frame 10 (the end of the whole flash movie).

The problem is that when I reach frame 10 and press the button, the mc from frame 5 doesn't play again. I don't get it why. It is in the state it finished playing. Logically thinking it should start playing AGAIN from the start if I move the playhead to the frame on the main timeline where it is nested.

From experiments, I figured out that when the mc lasts up to frame 9 of the main timeline and the button is pressed in frame 10 (when the clip is not present on the stage anymore) the mc DOES play again.

The same is if the button goes not to frame 5 but 4 (where the mc is NOT YET present on the timeline).

Can you give me any clue?


ps. one more question is bothering me but maybe I'll describe it in a new post.



5+ Year Member

Msg#: 3401350 posted 5:11 pm on Jul 22, 2007 (gmt 0)

The mc needs to re-init if it's initiated on stage. You probably need to tell the mc gotoAndPlay(1) from the button-click, or you could just go gotoAndPlay(4) on the main timeline every time.


5+ Year Member

Msg#: 3401350 posted 10:32 pm on Jul 22, 2007 (gmt 0)

Yeah, I've already tried with telling the mc to play from the beginning and it works. But I'm thinking about a potential situation where I may have 10 clips one day. It would be quite a deal to tell e a c h of them to play from the start.

I just thought if there is another way.

Thanks for the reply and making me more confident that my way of thinking is going right direction:)



5+ Year Member

Msg#: 3401350 posted 1:31 am on Jul 23, 2007 (gmt 0)

Well, the way we do this in Flash is by using eventListeners. By adding an eventListener to a movieclip, button, or any object, you can call a spesific function every time that event fires.

Look in the help files for samplecode. It's handled a little bit different in AS2 as from AS3, but it's kind of the same concept.


5+ Year Member

Msg#: 3401350 posted 1:51 pm on Jul 23, 2007 (gmt 0)

many thanks for the clue!

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved