Solved

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

Posted on 2006-06-29
5
295 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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 last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

738 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