# onReleaseOutside

**URL:** <https://forum.kirupa.com/t/onreleaseoutside/294434>\
**Category:** Uncategorized\
**Created:** [August 13, 2009, 9:52pm UTC](https://forum.kirupa.com/t/onreleaseoutside/294434 "2009-08-13T21:52:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigbstanley](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@bigbstanley](https://forum.kirupa.com/u/bigbstanley)\
**Post date:** [August 13, 2009, 9:52pm UTC](https://forum.kirupa.com/t/onreleaseoutside/294434/1 "2009-08-13T21:52:38Z")

</div>

Please be gentle as I know there a lot of posts on this, but I’ve still not been able to figure this out. I have a movieClip that is going to do a startDrag and a stopDrag, but the on MouseUp is not working and I need the onReleaseOutside functionality, however I’m getting errors and don’t really understand them. Here is my AS:

```auto

_bounds = new Rectangle(20, 20, 0, 500);
handle.addEventListener(MouseEvent.MOUSE_DOWN, dragSlider);
 handle.addEventListener(MouseEvent.MOUSE_UP, stopSlider);
 //handle.stage.addEventListener(MouseEvent.MOUSE_UP, stopSlider);

function dragSlider(evt:MouseEvent):void{
    evt.currentTarget.startDrag(true, _bounds);
    evt.currentTarget.stage.addEventListener(MouseEvent.MOUSE_UP, stopSlider);
    //stage.addEventListener(MouseEvent.MOUSE_UP, stopSlider);
    //evt.currentTarget.parent.stage.addEventListener(MouseEvent.MOUSE_UP, stopSlider);
}

function stopSlider(evt:MouseEvent):void{
    evt.currentTarget.stage.removeEventListener(MouseEvent.MOUSE_UP, stopSlider);
    //stage.removeEventListener(MouseEvent.MOUSE_UP, stopSlider);
    //evt.currentTarget.parent.stage.removeEventListener(MouseEvent.MOUSE_UP, stopSlider);
    evt.target.stopDrag();
}

```

My errors are either:  
_Error #1009: Cannot access a property or method of a null object reference.  
at media\_fla::MainTimeline/stopSlider()_  
or  
_Error #1069: Property stopDrag not found on flash.display.Stage and there is no default value.  
at media\_fla::MainTimeline/stopSlider()_

Please help and thanx in advance!
