1. Home
  2. Computing & Technology
  3. Animation

Flash Cursor Spotlight

By Adrien-Luc Sanders, About.com

9 of 10

Inside the on command, insert a startDrag command so that when the parameters of the on command are met, the object starts to drag after the mouse cursor to follow it over the stage. Initially there will be no target; only empty quotes (“”). Because we want the entire black area surrounding the spotlight to move when the mouse cursor is over the spotlight, we need to tell Flash to go back up to the root level to find the target, which is the instance of the entire black area (named as _root.black—the pointer to the root level, and then the instance name) and not just the symbol covering the transparent area inside.

on (rollOver, dragOver) {
startDrag (“_root.black”, true) ;
}

See that extra “true” in there? That’s there because I’ve checked off “Lock Mouse to Center”, so that when we mouse over the area in question, the cursor should automatically orient towards the center of the symbol.

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. Flash Cursor Spotlight

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

All rights reserved.