Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The button showed different effects when pressed multiple times?

Status
Not open for further replies.

Jennyucf

Instructor
Jun 22, 2001
215
US
Hi, there

I encountered a weired problem about the buttons. Any thoughts are very appreciated.

In the main timeline, there are two layers, which took 10 frames each. On each frame, there is a movie clip. On the first layer, there is the navigation button. On the button, I wrote the script like this: on release, _root.gotoAndplay("2"). What happens is that I pressed the button once, it went to play the movie clip on frame 2 on the main timeline. Then I clicked the button again when the movie 2 was playing, it then went to play movie 3, which lies on frame 3 in the main timeline. Did I make sense? Would you tell me why it happened?

Thank you!!!

Jenny
 
Don't really know if you're actually referring to frame numbers or number labels. If it's labels, you shouldn't be using numbers as labels, or at least not labels starting off with numbers... Use "one", "two"... Etc. If you must.
Using numbers alone as labels will get you in trouble! Regards,

oldman3.gif
 
In fact your button is just having the timeline play, regardless of where it should be going, and it stops on the next stop(); action. Another press just moves it to the next stop and so fourth. Regards,

oldman3.gif
 
Hi!! Thanks for still being there...
I actually used frame labels. It's good to know that frame labels should not be numbers.
So you mentioned that another press on the button just moves it to the next stop, what do I need to do so each time I press the button, it goes to play the designated frame labels on the main timeline?

P.S. Is that your picture on the signature?[wink]
 
_root.gotoAndPlay("frame_label"); or
_root.gotoAndStop("frame_label") are the right syntax.

Check the capital letters!

Just don't use numbers even in frame labels.

No, that's just a .gif I pick up on the web. I look much worst than that! [morning] Regards,

oldman3.gif
 
Hi, I tried both syntax.
when I use _root.gotoAndPlay("frame_label"); I pressed the button, it goes to the designated movie clip and begins to play, then when I press the button again while it's playing, it jumps to the next movie clip, which lies on the next frame on the main timeline.

When I use _root.gotoAndStop("frame_label"); I pressed the button, it goes to the designated movie clip and begins to play, then when I press the button again while it's playing, nothing happens. It begins to play from the beginning of that movie clip again after it's complete.

What can I do so each time I press the button, it begins to play from the first frame of that designated movie clip on the timeline? Thanks a lot!

...
What can I do to post some image as a signature? Looks like fun..:)
 
I see what you're saying, but can only say, IMHO, that the gotoAndStop is what you should be using. Don't really have time left to go into trying to solve your present problem...
Usually you would want the button not to have the effect you're asking for... If the movie clip is already playing, why would you want it to re-start? Some more coding could have this work, but I do have to go and prepare my suitcase!

Sorry! Regards,

oldman3.gif
 
You already did me a GREAT GREAT favor helping me with my project... I feel lucky to come to this forum. I will try some other way to see if I can get the solution. Really wish you a brilliant trip!!!

Have fun!![upsidedown]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top