Flash MX - GotoAndPlay - Problem

Hi Everybody!

I have a strange problem:

In my Document, I have a MC called Imagemov
which contains 8 different images in 8 different frames.
Each frame has a stop() in it.

If Button 2 in my document is being pressed, I want
the MC Imagemov to be played in the 2nd frame…
If Button 3 is being pressed, the 3rd frame…
and so on…

so far, it all works properly…

But if you press one of the Buttons
(for example Button 2) another time, the
MC Imagemov jumps to frame 3 instead of replaying
frame 2…

how come??? :q:

Voilà my Actionscript that I wrote into the
Buttons: (That one is for Button 2 :nerd: )

on (release) {
_root.Imagemov.gotoandplay(2);
}

Thanks a lot for your help :beam:

Cheers

Use gotoAndStop instead of gotoAndPlay :wink:

You don’t want to play your timeline, you want to stop at the specific frame. If you use gotoAndPlay, it plays the frame you go to, but it reads the stop action as well. It registers the stop action as on, so when you do gotoAndPlay again it plays starts playing your movie again. You shouldn’t have that problem with gotoAndStop()

oh… upps… :smirk:

Well, one never thinks about the easiest way
to solve a problem… :wink:

Seems I just outed myself to be a total newbie =)

Thanx a lot for your help!

Hope you have a nice weekend

Cheers

No problem man. Sometimes the easiest solutions are also the easiest to overlook.

You have a nice weekend too :slight_smile: