gsko Posted December 9, 2014 Share Posted December 9, 2014 I've tried to use the destory method but I can' seem to get it to work. Here's my code sample:tether_drag = game.add.sprite(530, 15, 'drag');tether_drag.name = 'tether_drag';tether_drag.inputEnabled = true;tether_drag.animations.add('pull');tether_drag.events.onInputDown.add(checkInputStatus, {sprite: tether_drag});I cannot set inputEnabled to false since I still need to be able to track if it is being clicked so I can send an error message. The checkInputStatus will see if the Sprite is active or inactive (i use Sprites health to keep track of active/inactive) and do that case. This is the code that fires if the Sprite is inactive:tether_drag.events.destory();and I also tried...tether_drag.input.reset(true);But the event keeps firing every time I click the Sprite. How can I stop the event from firing keeping in mind that inputEnabled needs to be set to true. Thanks, gsko Link to comment Share on other sites More sharing options...
shmikucis Posted December 10, 2014 Share Posted December 10, 2014 try thistether_drag.events.onInputDown.removeAll(); quiphop 1 Link to comment Share on other sites More sharing options...
gsko Posted December 10, 2014 Author Share Posted December 10, 2014 Perfect! Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts