flash buttons in down state
- Started
- Last post
- 8 Responses
- georgietexan
Does anyone know how the effect of the buttons once clicked stay in the down state until the next button is clicked? on this web site is the effect..
http://www.spartamusic.com/flash…
- unknown0
as if anyone is going to help a texan named george!
;P
- georgietexan0
OH come on I'm a hard working guy in need of some help.. please.. deep in the heart of TEXAS...
- mitsu0
the stars at night are big and bright....
- ********0
put butt in MC. Two frames. Frame 1 butt, from 2 graphic.
When butt clicked, send MC to frame 2 where no Butt is there.
Follow that?
- fusion410
You could place a button in a movie clip that has two frames labeled "on" and "off". Clicking calls a function which runs through a for/next loop that turns all the buttons in the series to "off" then turns the selected button "on". If you want your can also place your button commands within this function.
Here is the function. Put it on the root timeline at frame 1
// numButtons is the number of buttons in your movie.
// callingClip is the instance of the button clicked
function setButton(callingClip, numButtons){for ( i=1; i <= numButtons; i++ ) {
// turn all the buttons off
eval("pathToButton.button" + i).gotoAndStop("off");
}
// turn selected button on
callingClip.gotoAndStop("on");}
All your buttons MC’s would be named.
button1
button2
button3
etc.The function call on your buttons would read like this
on (release) {
//_root.setButton(this, insert number of buttons here);
}hope this helps
- ********0
My explanantion was clearer
- georgietexan0
cool thanks so much now back to my horse..
- majman0
instead of the for loop, I would do what MR_T said.
but in order to make the buttons return to their original state, define some sort of active btn variable, such as:
on(press){
_root.active.prevFrame();
_root.active = _name;
nextFrame();
}so you're telling the previously active button to go to the first frame, and then you define the active button as the one just clicked, and then you send it to the next frame....
good luck