AS Reference  :  Notes Index  :  Resources  :  About/Contact  :  Downloads

More Motion Tweens

On the last page, we saw how motion tweens can be used to move an object across the stage (in any direction), either in a line or following a drawn path. Motion tweening can also be used to:

Fade In (or Out)

To create a motion tween that fades a photograph (or any other object on stage) from 0% alpha (invisible) to 100% alpha, follow these steps:

  1. In a new layer, import the photo (eg, flower_pink.jpg in the example below).
  2. Convert it to a graphic symbol.
  3. Move the start keyframe of the photo to wherever you want the fade to begin. To move a keyframe, choose the Select tool, click the keyframe once to select it, then click-drag to move it. Make an end keyframe further down the timeline (the sample below uses a frame rate of 15fps, and each photo fades in over 15 frames).
  4. Click the starting keyframe and turn Motion Tween on in the Properties panel. Then click the photo in that frame and, in the Properties panel, click Color, choose Alpha and set it to 0%.

The steps above make one photo in one layer fade from 0 to 100% opacity. To add others, as in the example below, you can add more layers and repeat the steps above, staggering the start/end keyframes of each layer so they happen one after the other. You can open flowershow.fla in the class folder (link at right under Files) to see how that was done for the sample below.

Grow and/or Rotate

To get a graphic symbol to grow or shrink over a motion tween, just use the transform tool or Transform panel to resize the symbol in either the start or end keyframe of the motion tween. To get it to rotate, use the Properties panel instead. Click on the start frame of the motion tween, and choose CW or CCW from the Rotate dropdown box that appears once motion tween has been selected. You can set the number of times the object is to rotate over the duration of the tween in the 'times' box.

Change Color

You can apply a tint to a graphic symbol, in either the start keyframe or the end keyframe, or both. If the start and end keyframe have different tints, Flash will produce a smooth color transition between the two over the tween. Note: the tint will be applied to the entire symbol; there is no way to apply it to only part of the symbol. To do that, click on the symbol in either the start or endframe and, in the Properties panel, choose Tint from the Color dropdown box. Use the color and % boxes to apply a different tint. To produce a change in both color and transparency, you need to select Advanced under Color, and set each of the R,G,B, and alpha properties.

Intro
Flash: What & How
Example Sites
Create
Draw, Edit Shapes
Gradients
More Drawing Tips
Import
A Sample
Animate
Frames, Keyframes
Motion Tweens
More Motion Tweens
Shape Tweens
Masks
Control
Stop/Replay
Movieclips Intro
Movieclip Reference
Site Structure 1
Slideshow Movieclip
Contact Form
Scroll Resume
Preloader
Site Structure 2
Publish
Display Options
Player Detection
Optimize
AS 2.0 Basics
Intro to Syntax
Playhead Commands
Playhead Cmds 2
Coded Tween
onEnterFrame
Intro to Classes
Declare/Assign
Comments, Trace
Simple Data Types
Arrays & Objects
Code Blocks
Operators
Beyond Buttons
Code Structure
Toggle Controls
Group of Buttons
Drag and Hit
Distort Magnifier
Scroll Text
Bee Game
Dart Shooter
Sound Control
Easing Slider
Easing Slider 2
Components Intro
Timers & Delays
Dynamic Content
Intro
Drawing API
Create Text
Attach Movieclips
Easing Slider 3
Easing Slider 4
Load jpg/swf
Sliding Viewer
Preload swf
XML
Easing Slider 5
Server Comm
LoadVars (w/ PHP)
AS - PHP Lookup
Text File
Database 1:LoadVars
Database 2:Remoting
Read from directory
AS 2.0 Classes
Intro
Math
Key
Date
Color
EventDispatcher
New Samples
Pie Chart
Event-model Emailer
Tween Sequence
Fuse Sequence
SVG in Flash
Bitmap Topo
SWF as Data Holder
Two-level Menu
Yahoo! Flash Maps
Class-based Game
ASTB Samples
Disclaimer
3D Outlines
Bounce Collide
Address Book
Save Drawings
Home  :  Notes Index  :  Resources  :  About/Contact  :  Downloads