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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rollover state

Status
Not open for further replies.

manfishj

Programmer
May 30, 2002
44
US
Hi,
I'm relatively new to Flash. I've got a question. I know how to make a button with a rollover state...however...this is what I want to do..

I want to click on a play button for the sound to play. As long as the sound is playing, I want the play button to remain in its rollover state. Then, when the pause button is pressed, I want the pause button to remain in its rollover state for as long as its paused.

How do I make this happen? Thanks in advance.
 
So your play and pause button are the same but change when pressed...

The way I would do it is like this:

* Create your play and pause buttons (its probably a good idea to have them roughly the same size as well)
* Create a movie clip with two keyframes in it. Add stop actions to both frames. Give the movie clip a name...something like playpause
* Drag an instance of the play button into keyframe 1 and an instance of the pause button into keyframe 2
* Add actions to the play button which say:

on (release) {
tellTarget (_root.playpause.gotoAndStop(2)) {
}
}

* Add actions to the pause button which say:

on (release) {
tellTarget (_root.playpause.gotoAndStop(1)) {
}
}

That should do it. If you have any problems, I can email you a simple FLA which'll give you some idea of what to do.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top