Solved

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

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

Independent Software Vendors: 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

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

632 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