Advanced Methods | Motion on a Path
Back Help Next

Motion on a Path

But what if you don't want the box to move in a straight line? Let's see how we can make it follow an arbitrary path between two points on the stage. To do that we have to add a motion guide layer to the animation layer that we have just inserted.

Add a Motion Guide

Right click on the label for the layer in the timeline and select "Add Motion Guide" from the dialogue box that pops up. A new layer should appear in the timeline labeled "Guide:", followed by the name of the layer in which you put the tween; it has an arch-like symbol on it, indicating that it is a motion guide layer.

With this layer selected (recall that a pencil symbol indicates that a layer is selected, if it isn't, use the mouse to select it), use the pencil tool from the tool palette to draw a smooth path across the stage that you want the tween to follow. Now, we have to attach the keyframe symbols to this path. To make this easier, first go the the main menu and toggle "View" > "Snap" so that a check appears beside it (this isn't mandatory, but will cause the symbol to snap to the line and thus make the attachment easier). Now, select frame 1 in the timeline, select the box with the arrow tool, and move it until it snaps to the left end of the motion guide line that you just drew. Then, select the 2nd key frame in the timeline and use the arrow tool to snap the symbol to the right end of the motion guide on the stage.

Test the Movie

Test the movie, as above (remember to enable button actions first!). If you have done everything correctly, you should get a motion tween as before, but now the motion should follow your motion guide path. Once you have it working, you can hide the motion guide path (toggle under the "eye symbol" at the left of the timeline for that layer). Now the tween follows the invisible motion guide across the stage.

There is a lot more that you can do, but this gives an indication of the power of this animation technique. Even non-professionals can make pretty sophisticated looking animations in this way!

Next