Simple drag and drop graphics MixedMilkChO.. forked:0favorite:0lines:21license : MIT License modified : 2009-08-23 21:49:05 Embed Tweet package { import flash.display.MovieClip; import flash.display.Sprite; import flash.events.*; public class FlashTest extends Sprite { public function FlashTest() { var rectangleRond:Sprite = new Sprite(); rectangleRond.graphics.beginFill(0xcccccc); rectangleRond.graphics.drawRoundRect(0, 0, 100, 100, 50); addChild(rectangleRond); rectangleRond.addEventListener(MouseEvent.MOUSE_UP, up); rectangleRond.addEventListener(MouseEvent.MOUSE_DOWN, down); } public function up(me:MouseEvent):void { me.target.stopDrag(); } public function down(me:MouseEvent):void { me.target.startDrag(); } } } Code Fullscreen Preview Fullscreen and drag drop event graphics sprite startDrag stopDrag stopDrag startDrag MouseEvent addEventListener MouseEvent.MOUSE_UP MouseEvent.MOUSE_DOWN addChild Sprite