Question
Need help with if then based on var in my Canvas game.
On the main timeline I have
var clickCount = 0;In it's own movieclip I have this code so if a button is pressed it will increase the clickCount +1 and i want that if you reach 3 or more, it will tell another mc to go to a frame and play a frame name.
this.PumpkinButton.addEventListener("click", PumpkinDeath.bind(this));
function PumpkinDeath()
{
exportRoot.clickCount ++;
if (exportRoot.clickCount >= 3){
exportRoot.trickOrTreatMovie.gotoAndPlay("gameOverNoPrize");
}else{
exportRoot.TriesRemainingMC.play();
exportRoot.trickOrTreatMovie.play();
this.gotoAndPlay(2);
}
}But it's not working. What did I mistype?
Thanks ahead,
Line
