if score, the?
How can I make it so in my game if the dynamic text is 4 (in other words if the score = 4) that then it would go to another frame?
Hi,
Your dynamic text field obviously has a name, such as "score"
So use the code:
if (score ==4){
goto AndStop ("some_frame")
} else {
gotoAndStop ("some_other_frame")
}
cheerio
I got a similar case with a game and i want it when it reaches like 40 in score it loads an external swf like with loadMovieNum.
tried this but doesnt work:
if(scoreTextField = 40){
loadMovieNum ("index.swf",0);
}
Prid - Outing
If that code is on a frame, it will only be executed once, and that is when the Frame loads! Either use that code on your button actions, when increasing the scoreTextField, or use this modified code on your frame:
Actionscript Code:
onEnterFrame = function ( ) { if ( scoreTextField = 40 ) { loadMovieNum ( "index.swf" ,0 ) ; delete onEnterFrame ; } }
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
Thank you but it doenst work when the movie loads automaticly loads index.swf
Prid - Outing
sorry, wrote = instead of ==
new code:
Code:
onEnterFrame = function(){
if(scoreTextField == 40){
loadMovieNum ("index.swf",0);
delete onEnterFrame;
}
}
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
Thank you but it still doesn't work...
Here is the Fla file. For the time being i putted a button and that the game lasts some time and then goes there.
Please try to fix it.
Attached Files
Prid - Outing
I haven't thoroughly examined the FLA file, but the first error I spotted, is that scoreTextField is a textfield with a string, and not a number, therefore you can't check if it's equals to 40, because it's the variable, score , which is increased, and hence you have to check that one:
Actionscript Code:
onEnterFrame = function ( ) { if ( score == 40 ) { loadMovieNum ( "index.swf" ,0 ) ; delete onEnterFrame ; } }
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
omg it works ty very much!!!
Prid - Outing
No problem
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width