Drag

Code Actionscript 2.0

Instance action

on (press) {
this.startDrag(false);
}
on (release) {
this.stopDrag();
}

Code Actionscript 3.0

square.addEventListener(MouseEvent.MOUSE_DOWN, press); square.addEventListener(MouseEvent.MOUSE_UP, release); function press(e:MouseEvent) { e.target.startDrag(false); } function release(e:MouseEvent) { e.target.stopDrag(); }

Description

The square may be dragged by the mouse.

related to: Mouse position

Download

Right click: Flashfile AS 2.0 | Flashfile AS 3.0 | SWF-File


Share