Hey.
This might be a clear case but i’m stumped as to how to fix it:
public function setupDragDrop(asset:MovieClip) {
asset.addEventListener(MouseEvent.MOUSE_DOWN, function(e:MouseEvent) {
trace("1");
dd_container_mc.addChild(e.target);
e.target.startDrag();
});
asset.addEventListener(MouseEvent.MOUSE_UP, function(e:MouseEvent) {
trace("2");
e.target.stopDrag();
});
}
so basically just a function to add drag and drop functionality to an asset, note that when you mouse_down on the asset it takes it from where-ever it is and moves it to a container that sits at the top level in front of everything else.
This however appears to ‘disable’ the mouse_up event, which is never called in this case. If i remove the re-parenting then the mouse_up is called fine.
Can anyone explain why this is happening? Does re-parenting mean that an object will lose its event handlers?
Hope someone can help.
Cheers
Toby