Check if variable is true and play animation.
Hello, I want to be able to play an animation if a variable is true. "Checker" is dynamic text for seeing if the var SimpCarbPlay1 is true or false. It works, but what doesn't work is the if statement. That's what I'm really trying to do so when SimpCarbPlay1 is true, it should go to frame 30 and play.
var _this=this;
this.stop()
var SimpCarbPlay1 = "what";
this.checker.text = SimpCarbPlay1;
_this.Ybutton.on('click', MakeTrue);
_this.Bbutton.on('click', MakeFalse);
function MakeTrue() {
SimpCarbPlay1 = true;
_this.checker.text = SimpCarbPlay1;
}
function MakeFalse() {
SimpCarbPlay1 = false;
_this.checker.text = SimpCarbPlay1;
}
if (SimpCarbPlay1 == true) {
_this.gotoAndPlay(30);
}

thanks for your help.
dr
