1. Home
  2. Computing & Technology
  3. Animation

Custom Christmas Tree Ornaments that Move with Drag & Drop or Arrow Keypresses

By Adrien-Luc Sanders, About.com

5 of 9

The script used here is exactly the same as the script used for the various parts of the snowman animation:

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

In brief, when the user clicks the left mouse button (or only mouse button, on a Mac) and holds it down, the ornament clicked follows the mouse movements. When they release the mouse button, the ornament stops following the mouse movements and stays where it was dropped.

Explore Animation
About.com Special Features

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

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Animation
  4. Flash Animation Tutorials
  5. Custom Christmas Tree Ornaments that Move with Drag & Drop or Arrow Keypresses

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

All rights reserved.