# Help with onReleaseOutside for AS3

**URL:** <https://forum.kirupa.com/t/help-with-onreleaseoutside-for-as3/276966>\
**Category:** flash\
**Created:** [December 5, 2008, 6:31pm UTC](https://forum.kirupa.com/t/help-with-onreleaseoutside-for-as3/276966 "2008-12-05T18:31:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rondog](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rondog/32/2478_2.png) [@rondog](https://forum.kirupa.com/u/rondog)\
**Post date:** [December 5, 2008, 6:31pm UTC](https://forum.kirupa.com/t/help-with-onreleaseoutside-for-as3/276966/1 "2008-12-05T18:31:10Z")

</div>

I read senoculars post on this but cant figure it out

I am making a drag/drop file and if I am not over the clip I began dragging, it wont release. I added an event to the stage for MOUSE\_UP, but then when Im not over the clip I am getting an error:

```auto

ReferenceError: Error #1069: Property stopDrag not found on flash.display.Stage and there is no default value.
	at com.ronnie::DragAndDrop/upHandler()[E:\__AS3\com\ronnie\DragAndDrop.as:46]

```

Here is my code right now

```auto

package com.ronnie
{
	import flash.display.MovieClip;
	import flash.events.*;
	import gs.TweenLite;
	import gs.easing.Expo;

	public class DragAndDrop extends MovieClip
	{
		private var p:MovieClip;
		private var m:MovieClip;
		private var boxes:Array = new Array();
		public function DragAndDrop(parentClip:MovieClip)
		{
			p = (parentClip as MovieClip);
			m = p.mH;
			addEventListener(Event.ADDED_TO_STAGE, initBoxes);
		}
		private function initBoxes(e:Event):void
		{
			for (var i:int = 0; i < 4; i++)
			{
				var b:Box = new Box();
				b.y = i * 50;
				b.id = i;
				b.txt.text = "Hello, I'm box number " + (i + 1);
				b.txt.mouseEnabled = false;
				
				m.addChild(b);
				boxes.unshift(b);
				
				b.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
				b.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
			}
			removeEventListener(Event.ADDED_TO_STAGE, initBoxes);
		}
		private function startDragging(e:MouseEvent):void
		{
			var top:Number = 1;
			e.currentTarget.startDrag();
			e.currentTarget.alpha = 0.7;
			stage.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
		}
		private function stopDragging(e:MouseEvent):void
		{
			e.currentTarget.stopDrag();
			TweenLite.to(e.currentTarget,0.5,{x:0,alpha:1,ease:Expo.easeOut});
		}
	}
}

```

I need help so when I release on the clip or outside the clip it stops dragging.
