0
How to create a loop in this case?

/t5/animate-discussions/how-to-create-a-loop-in-this-case/td-p/5173362
Jun 25, 2013
Jun 25, 2013
Copy link to clipboard
Copied
Hi! I'm trying to use the if statement, but the code is only read once.
How do I get this code to be read several times?
For example, when the car passes the detector the number goes to 10.
So the code does not detect the if statement because the code is only read once.
Code:
var score: Number = 9;
if (score == 10)
{
gotoAndPlay (3);
}
TOPICS
ActionScript
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
LATEST
/t5/animate-discussions/how-to-create-a-loop-in-this-case/m-p/5173363#M210301
Jun 25, 2013
Jun 25, 2013
Copy link to clipboard
Copied
you could put that code in a function and use a loop (like enterframe to call it) or, even more efficent, call the function whenever score could be changed.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

