make my buttons work?
- Started
- Last post
- 3 Responses
- legspin
How do you get a button to on release/press goto and do something and when clicked again do something else. I can get the button to do this with a global variable but there are 2 buttons and I don't think the global variable is the way to go.
This script works for the one button:
home_btn.onPress = function() {
if (_global.sCurMovie == "sHome") {
tellTarget ("target A") {
gotoAndPlay("something");
} else {
tellTarget ("target B") {
gotoAndPlay("something else");
_global.sCurMovie = "sHome";
}
}Any ideas?
- UndoUndo0
your on the right track. use the variable as a switch. if its one state do something, if its another do something else. evrytime to click one of the buttons switch the state.
tip: dont use tellTarget anymore instead use _root.yourMCname.gotoAndPlay(2) etc for example
- System-Idle0
home_btn.onRelease = home_btn.onReleaseOutside = function(){}
- System-Idle0
ignore last post. useful but not relevant