Solved

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

Posted on 2006-06-29
5
282 Views
Last Modified: 2008-03-03
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?


0
Comment
Question by:paulp75
  • 3
  • 2
5 Comments
 
LVL 16

Accepted Solution

by:
sam85281 earned 500 total points
ID: 17015352
You need to use gotoAndStop() instead of gotoAndPlay()

I.e.:

on (release) {

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

}

-Sam
0
 
LVL 16

Expert Comment

by:sam85281
ID: 17015360
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
0
 
LVL 6

Author Comment

by:paulp75
ID: 17015590
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.
0
 
LVL 16

Expert Comment

by:sam85281
ID: 17019088
Try changing your "next" button action to this:

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

-Sam
0
 
LVL 6

Author Comment

by:paulp75
ID: 17025294
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
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question