I am having a problem making a Movie clip that acts as if it was a button. Can someone please describe how to make the 4 different button states on a MC??
Thanx in advance!
I am having a problem making a Movie clip that acts as if it was a button. Can someone please describe how to make the 4 different button states on a MC??
Thanx in advance!
two methods (or probably a dozen more=))
you can:
-place buttons inside a movie clip
-create 4 frames in a MC, use the hitTest function along with a onClick to tell whether the mouse is over the button, or clicking it…
Need an example file ?
I imagine you’d have to have the different states as frames on your MC.
So for example let’s say you have a green button that is an MC and on roll over you want it to turn red. We’ll on keyframe one of the MC the button would be green and on keyframe two it’d be red. Then for the actions on the MC you’d tell it to go to the 2nd frame on rollover. I forget the exact terminology (look up the reference for onRollOver for MCs) but it would be something like:
button.onRollOver.gotoAndStop(2);
You’d have to have a different keyframe for each state.
Hope this helps! =)
[edit]
Dang! I knew someone smarter would beat me to it and say it better!
[/edit]
Hey!
And example would be an asset… Thanx for your responses. The only main problem i’m having now is making it an actually work like a button by making a Hit State.
Thanx
[swf=“http://mlkdesign.online.fr/misc/kirupa/buttonMC.swf height=300 width=300”][/swf]
and http://mlkdesign.online.fr/misc/kirupa/buttonMC.fla
okay the coding is probably not that right (it works, but could be cleaner, I need a voets around here, or anybody else =))
onClipEvent (enterFrame) {
if (this._currentframe != 3) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
this.gotoAndStop(2);
this.onMouseDown = function() {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
this.gotoAndStop(3);
}
};
} else {
this.gotoAndStop(1);
}
}
}
:: Copyright KIRUPA 2024 //--