-
Hey!
I made a platform game from mad-sci's tutorial, but I want to make it so that when the score gets to a certain amount the movie jumps to a new frame. Here's the code I'm using in the frame:
if (score eq 8) {
gotoAndStop (2);
}
it doesn't work! I just can't figure out why.
when i pick up the item the score says 8 but nothing happens... Please help, I really need to know how to do this! ("score" is the name of the text-field that displayes the score...)
PS. I tried this code too but it was even more screwed up than the other one
if (score = 8) {
gotoAndStop (2); }
it just sets the score to 8! plz help!
-
*whispers* try:
Code:
if (score == 8) {
gotoAndStop (2);
}
I wont tell any one if you don’t!
-
P.S.
You should read page #160-161 in your ActionScript Reference Guide.
“Symbolic operators” are a must know if you would like to code any thing! Try to solve your problems, use what you have, then if you still need help try here. You will learn more if you do! Well good luck! :)
Meow!
-
thanx, but it didn't work either...
ok I'll read that, let's hope I'll learn something :)
PS. Cool cat btw, did you draw it yourself?
-
You might try:
Code:
if (score >= 8) {
trace ("testing ok!");
score = 0;
this.gotoAndStop (2);
}
If score is 8 or grater then 8 (X >= 8) ok :)
If it still dissent work you should look elsewhere in your code?
I have added a trace to see if the “if” statement is working at all? I am resetting the score to prevent the “if” from going off every frame!
You might also want to check the path to the variable “score” if the path is incorrect it will not work!
Well let me know if your still having troubles!
Ooo ya. I am an artist or sum junk! Thanks! :)