I need the number variable to change each time a button is pressed. The variable is called "total".
my stage code:
var total:Number = 4;
if (total == 5){
gotoAndPlay (2)
}
else if (total == 6){
gotoAndPlay (5)
}
else {
trace("there was an error ya PUTZ!!!")
}
my Button code:
on (release) {
set(total, 5);
}
Nothing happens when the button is pressed. There is nothing in the Compiler Errors.
Sorry if this is a stupid question. Im ass new to code and it can sometimes be hard to find flash tutorials. even sorry-er if this is formatted weird, still learning how to use this site and all that sorta stuff....
First of all, if you are starting anew, I advise to start with AS3, not AS1/2. Flash is dead anyway, but AS2 is like 15 years since obsolete so the amount and quality of tutorials and references are next to non-existent.
Then, your problem.
I don't remember, if set command is what I think you expect it to, but the basic = operator is still more readable and easier to understand.
Then, as you press the button, nothing seem to happen because your frame code is not a sleeping watchdog. It executes once and that's it. In order to get some reaction, you should set up some kind of watcher.
Frame script:
The button code: