Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

how to avoid dynamic textField overlapping createjs

Contributor ,
Mar 03, 2016 Mar 03, 2016

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

}

}

TOPICS
ActionScript
317
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 03, 2016 Mar 03, 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;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 03, 2016 Mar 03, 2016
LATEST

Uncaught SyntaxError: Unexpected token :

that means createjs does not support  text or numeric

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines