Flash
  Home arrow Flash arrow Page 6 - Animations and Interaction
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
FLASH

Animations and Interaction
By: Bill Sanders
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 14
    2004-07-07

    Table of Contents:
  • Animations and Interaction
  • Vector Graphics Versus Bitmap Graphics
  • Working the Timeline
  • Using Shape Hints to Morph Fonts
  • Tweening Imported Vector Graphics
  • Making and Using Guide Layers
  • Masking Layers
  • Echoing Layers
  • Timeline Effects
  • Choosing Positions for a Figure
  • Animating the Spearman and the Buffalo

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Animations and Interaction - Making and Using Guide Layers


    (Page 6 of 11 )

    The special layer in Flash used with motion tweens is the guide layer. Guide layers are used to draw a path for tweened objects to follow. In the first keyframe of a tween, the object is attached to the starting point of the guide, and in the second keyframe, it's attached to the ending point. When the movie plays, the guided object will follow the line used in the guide layer, no matter how circuitous. Imagine the flight of a bumblebee buzzing among the flowers and a line the bee might follow. If you draw such a line, using the Pencil, Bezier Pen, or Paintbrush tool, and then attach the bee object to that line, you'll see the kind of crazy path of a bee.

    Creating a guided path is simple, but many developers and designers have difficulty at first. So as a refresher or introduction, the following little project steps through the process of making and using guide layers:

    1. Open a new document. Add 30 frames and a second layer. Name the bottom layer Proton/Neutron and the top layer Electron 3.

    2. Click the Add Motion Guide icon, located below the bottom layer to the left. A guide layer appears above the Electron 3 layer, named Guide: Electron 3.

    3. In the Proton/Neutron layer, draw two overlapping spheres to represent the proton and neutron of an atom. Lock the layer. Then in the Guide layer use the Oval tool to draw an oval with no fill around the proton and neutron image in the middle of the Stage. Finally, using the Eraser tool, erase a notch in the oval, as shown in Figure 4.19. Lock the guide layer.

    4. In Frame 1 of the Electron 3 layer, create a small sphere using the Oval tool and a radial fill with no stroke line. (This will be the electron object.) Convert it into a Graphic symbol by pressing F8 and selecting Graphic.

    5. Click Frame 30 and insert a keyframe. Click Frame 1 of the Electron 3 layer, select Motion in the Tween menu, and with the Snap to Objects condition invoked, drag the electron object to the left side of the gap in the guide line, as shown in Figure 4.20.


      The Good and Evil of Snapping to Objects - After an unscientific survey, I discovered that Snap to Objects is turned on about 90% of the time when I don't need it and turned off 100% of the time when I do need it. The most important time for me to use Snap to Objects is when placing an object on a motion guide. Other times when I want objects to align with one another, I find the Snap option helpful.

      However, having said that, I definitely find that placing objects where I want them on the Stage is easier with Snap off. Using the grid and guidelines helps more than Snap, and for the great bulk of the work I do, the Snap option is off.


    6. Click Frame 30 and drag the electron object to the right side of the gap in the oval. Test the movie, and you should see the "electron" follow the path around the proton/electron in the center of the Stage.

    7. Repeat steps 2–6, creating Electrons 2 and 1 along with their guide layers and oval orbits. Figure 4.21 shows how the movie appears when completed.

    sanders

    Figure 4.19 - An oval-shaped guide path.

    sanders

    Figure 4.20 - Placing the object at the beginning of the path.

    When the file is tested as a compiled file, you'll see that the motion guides disappear. Only a single guide path (and no other objects, text, or drawings) should ever be placed on the motion guide layers.

     sanders

    Figure 4.21 - When the movie is complete, the three electrons have orbital paths around the neutron and proton.

    Tweening and Layers

    As noted in Chapter 1, the layers in Flash represent the stacked layers of glass early animators used to create depth and easily move characters within that depth. Thus, using layers, moving a character behind a tree was simply a matter of placing the layer with the tree at a higher level than the character hiding behind the tree. The same is true in Flash Pro. With the exception of a masking or transparent object, an object on a higher layer blocks the view of objects on lower layers.


    Lock and Snap - Once you have completed drawing the guide path on the guide layer, always lock the layer. As long as the layer with the object attached to the guide layer is unlocked, the object will still snap to the beginning or end of the guide line if the Snap option is on.


    When it comes to movement on a layer, Flash Pro is different from movement and animation on the old glass layers. When tweening shapes, you can place multiple shapes on a single layer and have them tween, or you can have different shape tweens on multiple layers. For example, if you place a single shape in a keyframe and then have three shapes in another keyframe with a tween between them, the single shape will morph into three shapes. However, when you're using motion tweens, each tweened object must be on a separate layer.

    This chapter is from Macromedia Flash MX Professional 2004, by Bill Sanders (Sams, 2004, ISBN: 0672326051). Check it out at your favorite bookstore today.

    Buy this book now.

    More Flash Articles
    More By Bill Sanders


     

    FLASH ARTICLES

    - Organizing Frames and Layers for Flash Anima...
    - Organizing Frames and Layers
    - Using XML and ActionScript with Flex Applica...
    - Interfaces and Events with ActionScript and ...
    - Manipulating Data with ActionScript in Flex ...
    - ActionScript Syntax for Flex Applications
    - ActionScript in Flex Applications
    - A Closer Look at Apollo`s File System API
    - Using the File System API
    - ActionScript 101
    - Flash Buttons
    - Advanced Flash Animation
    - Creating Your First Animated Movie with Flas...
    - Flash: Building Blocks
    - Building Preloaders






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT