Copy link to clipboard
Copied
I have an object which is supposed to work like this: when you click it is dragged, and when releasing the mouse occurs if the probe is touching the table. If so he should remain on the table, etc.
My problem is, that the check (MouseEvent.MOUSE_UP) occurs only if other objects (that can also be pressed) are not in the area, if they are in the same place where I release the mouse, they perceive the event, but I do not want them to take the event, but the object was dragged by mouse
Thanks all!
Copy link to clipboard
Copied
Make sure that the object you drag is always in the front of any other object on your stage.
use stage.numChildren-1 to get the highest index of any object on your stage, then set the Child Index of your dragged object to this value.
If you have dynamicly generated objects, put that function into an enter frame loop.
Copy link to clipboard
Copied
Thank you very much! helpfull answer!
I made sure the object is Upper, and really is an excellent responds to the mouse
Find more inspiration, events, and resources on the new Adobe Community
Explore Now