# Losing mouse\_up after reparent

**URL:** <https://forum.kirupa.com/t/losing-mouse-up-after-reparent/284379>\
**Category:** Uncategorized\
**Created:** [March 18, 2009, 4:12pm UTC](https://forum.kirupa.com/t/losing-mouse-up-after-reparent/284379 "2009-03-18T16:12:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tobyski](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@tobyski](https://forum.kirupa.com/u/tobyski)\
**Post date:** [March 18, 2009, 4:12pm UTC](https://forum.kirupa.com/t/losing-mouse-up-after-reparent/284379/1 "2009-03-18T16:12:35Z")

</div>

Hey.

This might be a clear case but i’m stumped as to how to fix it:

```auto
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
