Map with motion guide
[ August 21, 2005 ] by Emanuele Feronato aka Triqui
The "Indiana Jones map effect": show the movement of a character on a map.

Do you remember old Indiana Jones movies and the map showing Indy travelling around the world? It was the first movie, as far as I know, to show some red dots moving across a map to explain us where he was going.
Time passed, and now you can see this effect, with some variations, almost everywhere. So here it is a Flash movie with the same feeling.
It uses a motion guide and some actionscript to achieve the effect.
First, you need to know how to create a motion guide. I recommend you to read this tutorial to get started with Flash motion guides.
Once you have learned how to create a motion guide, it will be easy for you to create an animation like this one:

That's nice, but we want the "Indiana Jones" effect.
So we add some actionscript in the first frame:

inserted = 1;
steps = 4;

spot.onEnterFrame = function() {
   if (inserted%steps == 0) {
      _root.attachMovie("spot", "spot_"+inserted, inserted);
      _root["spot_"+inserted]._x = this._x;
      _root["spot_"+inserted]._y = this._y;
      _root["spot_"+inserted]._alpha = 100;

The clue is: have your main movieclip transparent (I called it "spot") and every 4 frames (you can change the value modifying "steps" variable) create a new, opaque object in the same position where your "spot" object is.
Here is the result (there is some actionscript in the last frame just to remove all movieclips and have the animation looping):

Ok... now you are ready to download the source code:

Flash MX 2004 version (225 KB)
Flash MX version (223 KB)

Name: Emanuele Feronato aka Triqui
Location: Venice, Italy
Age: 33
Flash experience: Using flash since 2000. And enjoying it!
Job: Run a web management agency
| Homepage | News | Games | Articles | Multiplayer Central | Reviews | Spotlight | Forums | Info | Links | Contact us | Advertise | Credits |

| | | |

gotoAndPlay() v 3.0.0 -- (c)2003-2008 gotoAndPlay() Team -- P.IVA 03121770048