Solved

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

Posted on 2006-06-29
5
288 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Updating Flash Player with GPO 3 356
Failed download 57 569
Advertising design for my own Purpose 5 85
Download Adobe Flash Player 6 67
I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

856 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