Flash AS3 Tutorials Center | Interesting Flash Animation Tutorials | Valuing Flash Animation Tutorials | Flash ActionScript and Animation Home

AS3 Beginner Tutorials | AS3 Basic Lessons | AS3 Valuing Courses | AS3 Components Tutorials | AS3 and PHP Interaction Tutorials
AS3 Practical Tutorials | AS3 Animation Techniques | AS3 Transition Effects Tutorials | AS3 Download Upload Files | AS3 Particle Systems
Communication Between Flash Movies with AS3 | AS3 and JavaScript interaction | AS3 Matrix Transformation | AS3 Physics Simulation Tutorials

Mouse Dragging MovieClip with Flash ActionScript 3

With Flash ActionScript 3, this is quite easy to use mouse dragging objects around on the stage.

Please update flash player to view this Flash ActionScript tutorial!

Flash Tutorial Content:

Many Flash application and games require using mouse to drag some objects on the stage. With Flash ActionScript 3, this is quite easy to accomplish this effect.

The complete Flash Movie is shown as above, you may try how it works before you start this tutorial.

Flash ActionScript Codes:

stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseStartDrag);


function mouseStartDrag(motion:MouseEvent):void {

// Start dragging when square_mc is pressed

// Dispaly message
output_txt.text = "Dragging Square now....";


stage.addEventListener(MouseEvent.MOUSE_UP, mouseStopDrag);


function mouseStopDrag(motion:MouseEvent):void {

// Stop dragging when square_mc is released

// Display message
output_txt.text = "Square was dragged to: " + "(" + square_mc.x + ", " + square_mc.y + ")";


Download Flash Source File:

Flash Source File mouse-4.fla


This Flash ActionScript tutorial shows how to drag objects or movieclip on stage.