1. Home
  2. Computing & Technology
  3. Animation

Flash Halloween Jigsaw Puzzle

By , About.com Guide

10 of 10

Now add another on command, this time an on (release) with stopDrag:

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

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

What we’ve told Flash is that when the mouse button presses down on the puzzle piece, it should “attach” to the cursor and follow it until the mouse button releases, at which point it should stop. This is very similar to the drag-and-drop pieces on the holiday snowman animation.

Using this to make sure that the actionscript references the particular movie clip that it’s attached to rather than a specific instance name will make it easier to add the drag-and-drop commands to the other pieces of your puzzle, because you can copy-paste the scripts in their entirety without any modifications.

Click here to see my example. I did mine in a hurry, so the pieces don’t interlock perfectly, but you’ll want to take more care with yours.

Explore Animation
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. 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. Holiday Themes
  6. Flash Halloween Jigsaw Puzzle

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

All rights reserved.