0

I create Container, attach onPress function to it, then add it as Child to the stage.

Then clear the stage ( so there is no such child there anymore ), update it.

but onPress is still working.

Herokiller
  • 2,891
  • 5
  • 32
  • 50

1 Answers1

1

what did you do the clear the stage?

stage.removeAllChildren() 

Make sure your stage has no children by checking:

console.log(stage.getNumChildren());

if you want to remove the onPress listener, I simply do to:

container.onPress=null;

It may not be the best way to disable it, but it works for me.