Skip to main content
August 21, 2008
Question

This variable is driving me nuts!!

  • August 21, 2008
  • 1 reply
  • 230 views
I've initialized a variable on the main timeline:
var varCourse:String = "incomplete";

From within a movieclip's (mc_myMC) timeline, I change my variable as follows:
this._parent.varCourse = "completed";

I return to the main timeline and want to display a message (mc_Message) based on my varCourse value. I realize that each time I enter the main timeline, varCourse is reset to "incomplete" so I will never be able to display mc_Message based on my varCourse value being changed to "completed" in mc_myMC. I can't initialize varCourse elsewhere in my file because I'm already at _root. How do I keep the value of varCourse from being reset to "incomplete" upon returning to the main timeline?

Thanks.
This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
August 21, 2008
use an if-statement to check if it's undefined. if so, assign it to be "incomplete", else do nothing.