Skip to main content
Inspiring
March 3, 2016
Question

how to avoid dynamic textField overlapping createjs

  • March 3, 2016
  • 2 replies
  • 341 views

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);

}

}

This topic has been closed for replies.

2 replies

Inspiring
March 3, 2016

Uncaught SyntaxError: Unexpected token :

that means createjs does not support  text or numeric

Ned Murphy
Legend
March 3, 2016

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;