Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Design > Adobe Creative Suite

This chapter is from the book

Animating Along a Path

In Flash, when you need to move objects in something other than a straight line, path-based animation is the simple, straightforward way to do it. In fact, moving symbols along a path is the only way to do it without programming special routines in ActionScript. (We'll cover those kinds of advanced techniques later in the book.)

Since we have already discussed how to make your movies more efficient by using symbols, the next logical step is to begin using those symbols to create movie clips. A movie clip is really nothing more than a symbol with two special properties: it has its own timeline, and that timeline runs independently of the main timeline. Because it's almost always a good idea to make whatever you create reusable, we will build the path-based animations you'll create inside a movie clip.

TIP

Movie clips are the most important building block in Flash. Using (and understanding) movie clips will raise your Flash work above the realm of the beginner. Think of a movie clip as a sort of super symbol that changes static symbols into rich, reusable objects. Even better, movie clips can contain other movie clips, allowing you to build behaviors and animations that can be combined into even more interesting and robust objects.

  1. Click on the Scene 1 tab near the top of the Flash application window, just below the main toolbar.

    Note the changes to the TEC logo when you change views.

  2. Create a new empty symbol by pressing Ctrl+F8 (Windows) or Command+F8 (Macintosh). Call it Electron Orbit, and make sure you specify Movie Clip as the symbol type. Click OK. Open the Library panel and double-click on Electron Orbit to edit the newly made symbol.

    Figure 20

    You won't see much of a change in your screen, but notice the tabs just under the horizontal toolbar. Next to Scene 1 you should see another tab labeled Electron Orbit. If you do, congratulations! You're in the right place.

  3. From the Library panel, drag the Orbit symbol onto the stage.

    Figure 21

    Center the Orbit object in the middle of the Electron Orbit symbol.

    NOTE

    "Center" is a relative concept in Flash. Each symbol has an origin which may or may not be the center of the object. The difference? The origin is the point that Flash will use to rotate the object or symbol. Therefore, if you want an object to rotate around something other than the physical or geometric center of the symbol, you'll want to relocate the object or the origin to suit your needs. The easiest way to do this is through the Info panel.

  4. Select the Orbit symbol on the stage, and then open the Info panel. Note the quadrant symbol next to the edit boxes for the X and Y values. Click in the center of this symbol to specify alignment to the center of the symbol. Change the X and Y values to 0.

    The quadrant symbol allows you to specify an alignment point. You can choose to see the coordinates for the center or the upper left corner.

    Figure 22

  5. Create a new, blank layer in the timeline. Drag the Dot symbol onto the stage.

    Figure 23

    Your 3D dot symbol now appears in the new layer.

  6. Move the dot over one of the end points of the elliptical arc on the first layer. Then right-click (Windows) or control-click (Macintosh) the new layer and choose Add Motion Guide from the contextual menu.

    Figure 24

    This will create a third layer, and indent the layer with the dot under it. Essentially, you have created a layer on which you can draw a path. The path you create will control the movement of the object on the indented layer. If this seems confusing, read on; we'll talk more about motion layers soon.

    NOTE

    In addition to being able to add a motion guide via the contextual menu, you can take advantage of the user interface. Just click on the Add Motion Guide icon under the layers area.

  7. Select the oval tool and draw an ellipse that follows the shape of the Orbit symbol. If the object you create is filled, delete the fill, leaving only the line. Select a small portion of the ellipse just below where you have positioned the dot symbol, and delete the selection.

    Figure 25

    NOTE

    Make sure that snap to objects (View > Snap to Objects) is turned on and that you are reasonably close to drawing an ellipse over the orbit symbol. This enables Flash to snap the ellipse into place and size it to match the orbit object.

    You want a path that is almost—but not quite—a complete ellipse.

    Every path must have a start and an end point. Because circles and ellipses have no beginning and no end, you must cut out a small section of their outline in order to create a path that Flash can use. Be sure to keep the gap between the start point and the end point small, because if you don't, there will be a noticeable jump as the object moves from the end point to the start point as it repeats its cycle.

  8. Select all the layers at frame 40 of the timeline. Extend the frames to that point. Select the middle layer (the one that contains the dot symbol) and create a keyframe. In the new keyframe at frame 40, move the dot symbol to the endpoint of the motion path.

    Figure 26

    Use Insert > Frames or the F5 key to extend frames out to a specified point.

    Create the keyframe by choosing Insert > Keyframe or pressing F6.

    Flash relies on keyframes as a way of defining "snapshots" of how you want each object positioned. Typically, there is at least one blank frame between the first and second keyframe. When you turn on Motion Tween (more on this in a minute), Flash calculates the differences between the way the symbol looks in the first and second keyframes and populates the intermediate frames with that interpolation.

    NOTE

    By default, every object in Flash has at least one keyframe; in our example, the first keyframe is at frame 1.

    TIP

    Flash has the ability to tween (automatically interpolate between keyframes), saving you a lot of time and trouble when you animate. There are two kinds of tweens—motion tweens and shape tweens, which apply to symbols and shapes respectively. You can't use motion tweens on shapes not already converted to symbols (well, technically you can, but Flash converts them to symbols for you—it just doesn't tell you about it, so it's much better to make your objects into symbols first). Shape tweens only work on (you guessed it) shapes. You might think that shape tweening is a really useful technique...right up until you try it. I consider shape tweening a last resort, as it's generally pretty difficult to make look exactly the way you want.

    What makes path animation different from a simple motion tween is the addition of what Flash calls a motion layer. A motion layer is much like a regular layer, but has several properties that differentiate it. First, a motion layer does not display any graphic content of its own when you export to SWF. Second, it is by definition bound to the layer or layers immediately below it. Third, if you draw a path on the motion layer, and if that path intersects both the instance of the object on the first keyframe and the instance of the object on the second keyframe, then the object will now tween along the path, instead of in a straight line.

  9. Click after the first frame of the Dot layer. Then right-click (Windows) or control-click (Macintosh) the new layer and choose Create Motion Tween from the contextual menu.

    Figure 27

    Unlike its behavior with a lot of other functions, Flash is very picky about following the rules for path-based animation. If your path and objects don't intersect precisely, the symbol will not tween along the path. If you don't get the results you want on the first try, it's usually because the symbol and the path are not perfectly aligned. Fortunately, you can turn on snap to objects (View > Snap to Objects) and either adjust the path itself or move the symbol on one or both of the keyframes until it snaps to the path object. If the path and symbol snap together on both keyframes, you should now be able to play your animation and see the dot following the path around the Orbit symbol.

    TIP

    Don't worry about hiding the motion guide layers—they automatically become invisible when you publish your Flash movie to the SWF format.

  10. Play the animation (Ctrl+Enter in Windows, Command+Return on a Mac).

    The dot now appears to orbit along the orbit path. Notice, though, that the Electron Orbit symbol curve is wider in some parts and thinner in others. In order to make this animation even more convincing, we'll scale the dot as it orbits.

  11. Click on the dot layer at frame 15, and then press F6 to create a keyframe. Click on the dot on the stage and open the Transform panel. Make sure the Constrain check box is checked, and then change the scale of the dot on frame 15 to 180%.

    Figure 28

    Flash understands that you want to make some sort of incremental change when you add a keyframe in the midst of a motion tween. By changing the size of the dot, you imply a sense of 3D motion, making it appear that the dot is moving closer and farther away as it orbits.

Peachpit Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from Peachpit and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about Peachpit products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites; develop new products and services; conduct educational research; and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email ask@peachpit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by Adobe Press. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.peachpit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020