1. Home
  2. Computing & Technology
  3. Animation

Flash Animation 19: Drag and Drop ActionScripting Commands

By , About.com Guide

5 of 5

Stopping Mouse Dragging

Now just return to your Movie Clip Controls, and this time double-click on stopDrag to insert:

stopDrag ( ) ;

This is, of course, the code to make the dragging event stop. Edited to refer to the containing object, it should read:

this.stopDrag ( ) ;

This again refers to the object that we're working within. Now you should be able to click and drag on your object to drag it about the stage; you'll have to do this for all of the other objects, as well, but the great thing about this code is that because it doesn't refer to a specific object by name but instead references each one as this from within the object itself, you can copy the code and paste it whole and unedited into the actions for each animated object. Play around with my completed animation to see how it works, here.

Explore Animation
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Animation
  4. Flash Animation Tutorials
  5. Flash Animation 19: Drag and Drop ActionScripting Commands

©2009 About.com, a part of The New York Times Company.

All rights reserved.