Jump to content

Weird? problem with inputEnabled


Recommended Posts

Hi guys,

so I have this problem with one sprite... I set the inputEnabled property to true, it works, cool.


Once I click on it, I disable it and at some point of the game I set it to true again, but weird thing, it´s not working.


First console.log -> true

Second console.log -> false

Everything is normal so far... but the second time that I call getBonus() the console.log, JUST AFTER the inputEnabled=true gives me false, and it´s just after the inputEnabled=true :wacko:

//PREVIOUS CODE...gotBonus:function(){     this.weaponIcon.alpha = 1;     this.weaponIcon.inputEnabled=true;     console.log("ACTIVATED = "+this.weaponIcon.inputEnabled);     this.weaponIcon.events.onInputDown.add(this.initWeapon, this);}//MORE CODEinitWeapon:function(){     this.weaponIcon.alpha = 0.5;     this.weaponIcon.inputEnabled=false;     console.log("ACTIVATED = "+this.weaponIcon.inputEnabled);            this.shoot();}

Does anyone know what is happening here?


Thanks in advance.

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...