forked from: Blue Shades Tetris

by hacker_johiroshi forked from Blue Shades Tetris (diff: 152)
♥0 | Line 20 | Modified 2010-05-18 09:42:15 | MIT License
play

ActionScript3 source code

/**
 * Copyright hacker_johiroshi ( http://wonderfl.net/user/hacker_johiroshi )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/eLOl
 */

package {

	import flash.display.MovieClip;
	import flash.events.MouseEvent;

	public class StartStopDrag extends MovieClip {
		
		public var myMovieClip:MovieClip;
		public var myMovieClip2:MovieClip;

		public function StartStopDrag() {
			myMovieClip.addEventListener(MouseEvent.MOUSE_DOWN, onStartDrag);
			myMovieClip.addEventListener(MouseEvent.MOUSE_UP, onStopDrag);
			
			myMovieClip2.addEventListener(MouseEvent.MOUSE_DOWN, onStartDrag);
			myMovieClip2.addEventListener(MouseEvent.MOUSE_UP, onStopDrag);
		}
		
		private function onStartDrag(evt:MouseEvent):void {
			evt.target.startDrag();
		}
		private function onStopDrag(evt:MouseEvent):void {
			evt.target.stopDrag();
		}
	}
}