Link to home
Start Free TrialLog in
Avatar of paulp75
paulp75Flag for Australia

asked on

when i click button twice it goes to the next frame in movieclip

i've set up a small slide type thing, so i have 3 thumbnails and using arrows on either side it will scroll through
i have this script on the next button
on (release) {
      nextFrame();

}

and this one on the previous
on (release) {
      prevFrame();

}

and it runs through the frames on the timeline ok. Except for some reason it wants to start at frame 2, even though theres a stop at frame1

anyway the main problem i have is that when i click the thumbnails it directs to the movie
like this

on (release) {

      //Movieclip GotoAndPlay Behavior
      this.bedroomslides.gotoAndPlay("renee");
      //End Behavior

}

when i click on the thumbnail button, it goes to the correct frame, but if i click on the button again, it goes to the wrong frame.
i have tried using absolutepath aswell but it didnt make any difference.

anyone able to help?


ASKER CERTIFIED SOLUTION
Avatar of sam85281
sam85281

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sam85281
sam85281

So you know why...

gotoAndPlay goes to the frame and plays it.  If there's a stop action and YOU ARE NOT on that frame, the stop will catch it.

If you're on the frame, it just plays the timeline because the actions, including stop() have already been ran.

Using gotoAndStop will fix this.  You only want to use gotoAndPlay in applications where you actually NEED it to play on from that frame and not stop on it.

-Sam
Avatar of paulp75

ASKER

awesome stuff. and thanks for the explaination
that fixed it
any reason when i click on the slide, it takes it to the 2nd frame, instead of the first of the slide.
very strange. can't understand that one.
Try changing your "next" button action to this:

on (release) {
if (_currentframe == _totalframes) {
gotoAndStop(1);
} else {
nextFrame();
}
}

-Sam
Avatar of paulp75

ASKER

i'll put the slide starting at frame 1 in another question. thanks for the answer on the main question.
and great explaining also.
much appreciated