package dnd {
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	import flash.geom.Point;
	
	
	
	
	public class bolt_tb extends MovieClip{
		
		protected var origPos:Point;
		
		public function bolt_tb() {
			// constructor code
			buttonMode = true;
			origPos = new Point(x,y);
			
			addEventListener (MouseEvent.MOUSE_DOWN, down);
		}

		protected function down (event:MouseEvent):void
		{
			parent.addChild(this);
			startDrag();
			stage.addEventListener (MouseEvent.MOUSE_UP, stageUp1);
		}
		
		public function stageUp1 (event:MouseEvent):void
		{
			stage.removeEventListener (MouseEvent.MOUSE_UP, stageUp1);
			stopDrag();
			if (dropTarget)
			{	
				if (dropTarget.parent.name != "top_1" ||  dropTarget.parent.name != "top_2" ||  dropTarget.parent.name != "top_3" ||  dropTarget.parent.name != "recycle" || dropTarget.parent.name != "root_1" || dropTarget.parent.name != "go_On" || dropTarget.parent.name != "border_toptb")
				{
					visible = false;
					
				} else {
					returToOrigin();
					
					}
			}
		}
	
		protected function returToOrigin():void
		{
			x=origPos.x;
			y=origPos.y;
		}
	}
	
	
}
