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

6 of 9

You can copy-paste the drag-and-drop Actionscript into the Actions for all of the ornaments, or even save it in an external file and reference it with an include.

Once you’ve finished with the ornaments, create a new movie clip symbol on the stage; either make it so small that it’s impossible to see, or set the fill to 0% opacity with no outline, much like an invisible hotspot button.

This invisible symbol will be our controller for the keypresses that will move the ornaments. We can’t assign the ActionScripts to the ornaments themselves without excessively complicating things (and trust me, I tried, and tore a little hair out in the process). Flash gets confused, and either moves everything all at once or moves the same ornament every time no matter which ornament you’ve selected. Because we’re using the exact same keys to control all of the ornaments but we only want to move one ornament at a time, we need to use an external symbol to control the motion of whatever ornament is currently considered “active”.

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.