Copy link to clipboard
Copied
we fix this issue in as3 using var hitBool:Boolean
but createjs does not support Boolean ; so how can we fix the issue ? LOL
/* js
var score=0;
var hitBool=false;
this.movieClip_1.addEventListener('click', fl_MouseOverHandler_2);
function fl_MouseOverHandler_2(e)
{
if(!hitBool){
hitBool=false;
text1 = new createjs.Text("LIVES: " + score, "40px Arial");
text1.textAlign = 'right';
text1.y = 30;
text1.x = stage.canvas.width - 10;
stage.addChild(text1);
score=score+10;
text1.text=String(score);
}
}
Copy link to clipboard
Copied
If it doesn't support Boolean then use text or numeric instead.
var hitBool:Number = 0;
if(hitBool == 0)
PS - the following is not logical because to get thru the conditional the value has to already be false, so there is no need to make it false
if(!hitBool){
hitBool=false;
Copy link to clipboard
Copied
Uncaught SyntaxError: Unexpected token :
that means createjs does not support text or numeric
Find more inspiration, events, and resources on the new Adobe Community
Explore Now