Search:                                                     

[index_add/searchmain.htm]
[pages/search_page.htm]
  
Motion
Guide
 kirupa chinnathambi
 
A motion guide, in Flash, enables you to make an object follow a path that you specify. The path that you specify will be located on a separate layer known as a guide layer. Most people have this notion that a motion guide is only a squiggly line. In this tutorial, I am going to explain how to create a motion guide that is not a squiggly line!

The following instructions will help you to create a motion guide:

  1. Create a new movie in Flash. You will see Layer 1 displayed in the timeline. Right click on the layer marked Layer 1 and select Add Motion Guide. Your timeline should look like the following image:

  1. Ensure Layer 1 is selected, and draw a square in your working/drawing area.
     
  2. Select the Guide layer and draw the outline of a circle. You can draw an outline of a circle by removing the fill color and only leaving the border visible. To only display the border of a circle:
    1. Select the Oval tool from the Toolbox.
    2. Click the Fill Color tool and the color menu will drop-down. Select the empty box (top-right of menu) with a red stripe going diagonally to remove the fill color.
    3. Draw your circle now. You will only see the outline of the circle:

  1. Select the center of the square and drag it toward the circle outline you just drew. When you drag the center of the square toward the outline, you will see the center of the square snap to the outline as displayed in the following image:

  1. Insert a keyframe in Frame 20 in both the guide and Layer 1 layers. Lock the guide layer by pressing the center dot to the right of the Guide: Layer 1 label. Once the keyframe has been inserted and the guide layer has been locked, select Layer 1 of Frame 20 and drag the center of the square to the opposite end of the circle's outline. The square will again snap to the outline as shown in the following image::

  1. Let's animate the square! Select all the Frames between 1 - 20. Right click on the selected frames and select Create Motion Tween. Now, preview the animation by pressing Ctrl + Enter.

When you previewed the animation, the square rotated half-way around the circle to reach its final destination on the other side of the circle outline. That's all there is to making an object follow a guide path. Of course, in classic kirupa.com tradition, the source code has been provided so you can see compare your FLA to that of mine. Click Here to Download the Source Code.

I hope the information helped. If you have any questions or comments, please don't hesitate to post them on the kirupa.com Forums. Just post your question and I, or our friendly forum helpers, will help answer it.

The following is a list of related tutorial and help resources that you may find useful:

How to use the Forums
New, Upcoming, and In-Progress Tutorials
How to Help out kirupa.com
Writing Tutorials
 
Cheers!
Kirupa Chinnathambi
kirupaBlog

 

[pages/rightinfo.htm]
  schematic:
  Motion Guide
  Download FLA
   

 navigation:

tutorials:
Flash 5
  Basic
  Animation
  Special Effects
  Advanced
  Screenshots
  Forums
  Buy Flash 5
ActionScript
Flash 4
Flix
Other Tutorials
books:
FrontPage 2002: ABG
Flash Books

features:

[pages/gl.htm]
 
 

 
 updates:

The following links are tutorials that have been added or updated recently to this site:

  Duplicate Movie
Collision Detection
Add Sound
Swap Depth
Falling Snow
 
  [developer/opinion.htm]

 

 

 

 

 

 

 

 

 

 

 


 

 

Return to Previous Page