# Droptarget 1009 error

**URL:** <https://forum.kirupa.com/t/droptarget-1009-error/325153>\
**Category:** Uncategorized\
**Created:** [September 28, 2011, 7:39pm UTC](https://forum.kirupa.com/t/droptarget-1009-error/325153 "2011-09-28T19:39:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kdteacher](https://avatars.discourse-cdn.com/v4/letter/k/a9adbd/32.png) [@kdteacher](https://forum.kirupa.com/u/kdteacher)\
**Post date:** [September 28, 2011, 7:39pm UTC](https://forum.kirupa.com/t/droptarget-1009-error/325153/1 "2011-09-28T19:39:59Z")

</div>

I am teaching with an basic AS3 programming class and we are looking at drag/drop. I cannot get the following code to work without a 1009 error when not dropping the ball into the inventory box.

What we are trying to accomplish is creating an inventory for an adventure game.

```auto
function ball_drag(event:MouseEvent):void {
           ball.startDrag();
           }
ball.addEventListener(MouseEvent.MOUSE_DOWN,ball_drag);

function ball_drop(event:MouseEvent):void {
           stopDrag();
           if (ball.dropTarget.parent == inventory_box) {
                             trace("it worked!");
           }
    }

ball.addEventListener(MouseEvent.MOUSE_UP,ball_drop);

```

Thanks in advance, file is attached.
