I have added an on click event to a child object which is not always displayed
Its pearent object also has on click events.
There are two problems.
Whenever I click on the child object the pearents onclick behavior also runs. I do not want this to happen.
The child object can be clicked on even if i set its alpha to 0, or set its display property to false or send it to the back of the stage. This means its behavior can be invoked by the user even if it is not visiable
to put it another way
I dont want the child object to be clickable when it is not dispayed
I dont want the pearent object to be clickable through the child object
how do i fix these issues?
1. use your child's mouseevent's stopImmediatePropagation() method
2. assign your child's mouseEnabled property to false, remove it from the displaylist or assign its visible property to false.