# Need help drag and dropping an object to a target MC inside a MC

**URL:** <https://forum.kirupa.com/t/need-help-drag-and-dropping-an-object-to-a-target-mc-inside-a-mc/303902>\
**Category:** Uncategorized\
**Created:** [January 28, 2010, 8:41pm UTC](https://forum.kirupa.com/t/need-help-drag-and-dropping-an-object-to-a-target-mc-inside-a-mc/303902 "2010-01-28T20:41:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nick5014](https://avatars.discourse-cdn.com/v4/letter/n/48db29/32.png) [@nick5014](https://forum.kirupa.com/u/nick5014)\
**Post date:** [January 28, 2010, 8:41pm UTC](https://forum.kirupa.com/t/need-help-drag-and-dropping-an-object-to-a-target-mc-inside-a-mc/303902/1 "2010-01-28T20:41:10Z")

</div>

Hi guys. I want to drag an item thats on stage onto a target thats inside a movieclip thats on stage. The below code works great if both the item im dragging and the target for it are on the main frame.

```auto
var myTargetName:String = "target" + event.target.name;
    var myTarget:DisplayObject = getChildByName(myTargetName);

if (event.target.dropTarget !== null && event.target.dropTarget.parent == myTarget)
{do something}

```

But i just cant get it to work if the target is inside a movie clip. (in my case, the target is inside a mc called “bg1”. Can anyone help?

thanks
