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

9 of 9

The last thing that you need to do is go back to the scripts for each ornament, and insert one extra line to the on (release) function:

_root.active=_root.redball() ;

Replace my redball1 with the instance name for your selected ornament, and then rinse and repeat for all of your ornaments and their respective instance names. Since we told the invisible controller’s scripts to move whatever ornament is defined as _root.active when the arrow keys are pressed, this line sets the most recently-clicked ornament as _root.active when the mouse button is released after the click.

That’s the end of it. Happy decorating.

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.