PDA

View Full Version : Button question...



mlkedave
January 12th, 2004, 07:46 PM
I have a question with buttons... I am using this code:
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.nextFrame();
} else {
this.prevFrame();
}
}

to rewind and play a movieclip depending on if the mouse is over the button. The only problem is I want it so when you release the botton (onRelease), then The button changes color (until another button is chosen, in which case that button changes color and the origignal button changes back). How do I make it so when onRelease the button GotoAndPlays another frame? Any suggestions? Thanks.

Mike

Uli
January 12th, 2004, 10:54 PM
The easy way would be to place your button at state 1 on the 1st frame on a MC and your button at state2 on the 2nd frame. Add a stop each time. Name the instance of your MC.

Then use
root.yourButtonMC.gotoAndStop(1)
root.yourButtonMC.gotoAndStop(2)