Welcome Guest [Log In] [Register]
Welcome to Brackenwood. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Play/pause; Button
Topic Started: Oct 7 2004, 06:51 AM (125 Views)
ASH 321
Member Avatar
Animator
How do I make a button that lets you pause the animation? then one that lets you play it again? thats there all the way through the animtion and lets you pause it at the exact frame you press the button...
Offline Profile Quote Post Goto Top
 
chluaid
Member Avatar
Bitey's Daddy
Admin
Create a 'pause' button symbol

  • draw a button (a simple square will do for now)
  • hold down Ctrl (temporary Arrow tool) and drag a selection marquee around the square to select it
  • press F8 (Convert to Symbol)
  • Choose 'Button' as the symbol type, and enter the name 'pauseButton'.
Add a stop action to the button

  • Make sure the button symbol is on the stage and is selected
  • Press F9 to open the Actions Panel
  • type the following code into the Actions panel:
    Code:
     
    on (release){_root.stop();}

  • close the Actions Panel
Now if you place that button in your movie, the user can click it and the movie will stop playing.

Create a 'play' button symbol

  • draw another button (perhaps a right-facing triangle to indicate 'play')
  • hold down Ctrl (temporary Arrow tool) and drag a selection marquee around it
  • press F8 (Convert to Symbol)
  • Choose 'Button' as the symbol type, and enter the name 'playButton'.
Add a play action to the button

  • Make sure the play button is on the stage and is selected
  • Press F9 to open the Actions Panel
  • type the following code into the Actions panel:
    Code:
     
    on (release){_root.play();}

  • close the Actions Panel

As with the stop/pause button, place this play button anywhere in your movie. The user can click it to resume playing after the movie is stopped.

You'll probably only want the stop button visible when the movie is playing, and likewise, if the movie is stopped, we don't need to see the stop button - just the play button.

Good luck!
Offline Profile Quote Post Goto Top
 
ASH 321
Member Avatar
Animator
THX! :D Helped loads (hehe more stuff to show off with :lol: )
Offline Profile Quote Post Goto Top
 
ASH 321
Member Avatar
Animator
Do you know how to make a pause button? Im not sure if its possible :worry: ? But if you know it would be very much appreciated
Offline Profile Quote Post Goto Top
 
Markham Carroll
Member Avatar
Custom member title
The stop(); action just stops it at the current position, like a pause button would do on a VCR.
Offline Profile Quote Post Goto Top
 
ASH 321
Member Avatar
Animator
I forgot to say I hade to make the code different.. I hade to change the stop to

Code:
 
on (release) {
stopAllSounds();
}


And play to

Code:
 
on (release) {
gotoAndPlay("play");
}


And all these do are PLAY the music then STOP it (which makes it go back to the start) I wanna make a button that makes it PAUSE so it stops in its place and does go back to the start...

Offline Profile Quote Post Goto Top
 
chluaid
Member Avatar
Bitey's Daddy
Admin
if your sounds are set to 'Streaming', there is no need to stopAllSounds when you pause :D

and if you don't want the movie to go back to the start, then your problem lies in this:

Code:
 
on (release){
gotoAndPlay ("play");
}
Using this code means that each time you press that button, you'll restart from the frame labelled 'play'.

If you simply say:
Code:
 
on (release){
play();
}
it will resume play from the point at which it is stopped.
Offline Profile Quote Post Goto Top
 
ASH 321
Member Avatar
Animator
I still dont understand :worry: I used that code and it work but it just makes it play and that code is for the play button. I wanted a code for a pause button....
Well never mind Guess I just dont understand thx anyway :)
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Application Support · Next Topic »
Add Reply