# Dragging an object and onRelease

**URL:** https://forum.kirupa.com/t/dragging-an-object-and-onrelease/277817
**Category:** Uncategorized
**Created:** [December 17, 2008, 3:26pm UTC](https://forum.kirupa.com/t/dragging-an-object-and-onrelease/277817 "2008-12-17T15:26:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kritikal](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kritikal/32/1699_2.png) [@kritikal](https://forum.kirupa.com/u/kritikal)
#### Post date: [December 17, 2008, 3:26pm UTC](https://forum.kirupa.com/t/dragging-an-object-and-onrelease/277817/1 "2008-12-17T15:26:09Z")

</div>

Hey guys,

so I have an object on stage when the mouse is rolled over it the object will attach itself to the mouse (startDrag), the problem I’m having is that I still need the user to click on different objects while dragging that object but the onRelease function isn’t registering.

Here’s basically what I have

```auto

 
sucre = function():Void
{
  this.onEnterFrame = function(){
  if( _root.packaging._currentframe >= 64 )
  {
   _root.packaging.onRollOver = function() {
     if(_root.idx != null) {
       trace("clearInterval");
       clearInterval(_root.idx);
     }
    this.startDrag(true);
    _root.idx = setInterval(startDraw, 35);
   };
  }
}
 
//
 
myObject.onRelease = function():Void {
  trace("works!");
}

```

any idea why it’s not working?
