Skip to main content
Participant
February 28, 2011
Answered

loadMovieNum not working

  • February 28, 2011
  • 1 reply
  • 307 views

Hi there, I'm in the process of making a game where when the player gets a score of 5 a movie is loaded onto the screen. The code I've tried is:

if (counter==5){

loadMovieNum("randomfact.swf", 2);

}

Counter is the name of the dynamic text that counts the score.

If anyone could give any advice or a better way to do this that would be great.

Thanks for your time

TheEzmonator

This topic has been closed for replies.
Correct answer Ned Murphy

If counter is the instance name of the textfield, then you should be using...

if (counter.text == "5"){

   loadMovieNum("randomfact.swf", 2);

}

You should try tracing the counter value before the conditional to see what value is there.  You are safer using a variable to keep count and just use the textfield to display the count value.

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
February 28, 2011

If counter is the instance name of the textfield, then you should be using...

if (counter.text == "5"){

   loadMovieNum("randomfact.swf", 2);

}

You should try tracing the counter value before the conditional to see what value is there.  You are safer using a variable to keep count and just use the textfield to display the count value.