Flash scripting question
- Started
- Last post
- 4 Responses
- CygnusZero4
I have a 3 frame timeline with a list of standard issue text button clips. Each of them when clicked jumps to a specific frame.
Using AS2, I have to for this project.
My question is on each frame, is it possible to have a script that tells the corresponding button to stay in its rollover state, then when another button is clicked, it goes back to its default state?
Somehow target it and say, "When on this frame, stay on your rollover state (frame 2). When any other button is clicked, go back to your default state (frame 1).
- omg0
//header
onclick
allButtonHighlights=0;
this.button.highlight=true;
- mikotondria30
I would use standard movie clips 'as' the buttons, and control what frame they were on. Buttons didn't always want to behave afair...
- fyoucher10
Turn em into movieclips, stop frame on 1st frame.
Then use variables and have your button code check them:
var currentButton:Movieclip;
btn1.onRelease() = function:Void {
//This is the 1st time a button is pressed
if (currentButton == undefined ) {
currentButton = this;
this.gotoAndStop(2); //over state
return();} else {
currentButton.gotoAndStop(1); // previous button back to default
this.gotoAndStop(2);
}
}Then fill in the rest of the button code
- or change that entire thing into a reusable function / method...fyoucher1
- moldero0
- Sometimes, I do too. Great for just jamming in, multiple ways of approaching problems. Other times it just wouldnt f**g work!mikotondria3