PhillyPride88
06-08-2010, 04:56 PM
Hi there everyone! After being on the sidelines and playing a few flash games, I have had the urge to learn Flash (and subsequently actionscript), and create a game of my own.
Things seem simple and tricky at the same time. I picked up buttons and how to use those to move to a different frame, but the game I want to make needs to use variables as path deciders.
Alright, say I have set up a variable called money. I set it up as {money = 1000;} making it a constant throughout my frames.
I made a frame right after that that is identical to the other. I then made a button on the first frame that would go to the next frame.
What I tried after that failed miserably. Pretty much, I coded the second frame with the command...
if (money == 1000){
_root.gotoAndStop(b);
}
By the way, I had set up three other frames as go to frames (a, b, and c)
I also set up two other commands
if (money < 1000){
_root.gotoAndStop(a);
}
and
if (money > 1000){
_root.gotoAndStop(c);
}
I was expecting when I tested the flash that after I clicked the button to get to the frame that would make the decision...nothing changed, it just stayed there. What am I doing wrong?
I have more questions, but I figured I'd take it one at a time.
Things seem simple and tricky at the same time. I picked up buttons and how to use those to move to a different frame, but the game I want to make needs to use variables as path deciders.
Alright, say I have set up a variable called money. I set it up as {money = 1000;} making it a constant throughout my frames.
I made a frame right after that that is identical to the other. I then made a button on the first frame that would go to the next frame.
What I tried after that failed miserably. Pretty much, I coded the second frame with the command...
if (money == 1000){
_root.gotoAndStop(b);
}
By the way, I had set up three other frames as go to frames (a, b, and c)
I also set up two other commands
if (money < 1000){
_root.gotoAndStop(a);
}
and
if (money > 1000){
_root.gotoAndStop(c);
}
I was expecting when I tested the flash that after I clicked the button to get to the frame that would make the decision...nothing changed, it just stayed there. What am I doing wrong?
I have more questions, but I figured I'd take it one at a time.