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

Shape Tweens

Unlike a motion tween, a shape tween requires that you start and end with a native Flash shape, rather than a symbol. Flash uses the vector information of the shape (or shapes) in the start keyframe and the changed vector information of the shape in the end keyframe to construct intermediate frames. Shape tweens can be used to morph objects from one shape to another, or they can be used to quickly set up a tween when one shape, or a group of shapes, shifts position or size or color (without having to change the content to a symbol first). Shape tweens often don't work well when the shape in the start keyframe is very different (especially in number of vectors that define it) from the shape in the last frame. Here's an example of using a shape tween to provide an animated cartoony bounce:

Open a new 500x200 movie and draw a floor in one layer and a round ball in the air in the layer above. Extend the timeline to frame 16. Put a keyframe in frame 8 and another in frame 16. In keyframe 10, drag the ball down over the floor. Click in frame 1 and choose Shape from the Tween box in the Properties panel. Click frame 8 and repeat. You should see arrows over green shading in the timeline, which represents a shape tween. Control, Test Movie should produce something like:

Let's see if we can make the bouncing a bit more convincing. Click frame 1 and set the Ease to 100 (Ease Out) in the properties panel. Do the same for frame 8. Turn on onion skin outlines to see that the end frames of the tween now appear closer together than the beginning frames. Control, Test Movie to see.

Use shape changes for cartoon effect

Adding a little shape change to the ball will emphasize its bounce even more. In frame 1, use the transform tool to squash the ball up a bit vertically. Move the keyframe in frame 8 back to frame 5. Add a keyframe in frame 6. In that frame, squash the ball vertically and spread it horizontally (making sure the ball ends up lower in this frame than in frame 5 -- this is the bottom point of its bounce). Put a blank keyframe in frame 7. Copy the content of frame 5 into frame 7 (using cmd-shift-v to paste in place). Add a keyframe in frame 14. Squish the ball horizontally and spread it vertically. Move keyframes or add extra frames if desired (we put another frame in after frameNow the bounce should look something like:

Move the ball across the stage with a motion tween

Finally, the ball can be made to bounce across the screen by creating a bouncingball movieclip and motion tweening it across the stage. The steps to do that are: cut the frames of the ball layer onto the clipboard (select frames, right-click, Cut Frames), create new movieclip bouncingball, click in frame 1 and paste the frames into it. Go back to the main movie (scene1) and drag the new movieclip from the library into the ball layer and extend the timeline for both layers out (I extended to frame 85, with the frame rate changed to 20 fps). Put a keyframe in the last frame of the ball layer, move the ball offstage at far right, shrink it, and set its tint to 80% of the floor color (or any other modifications you want to make to make it look as though the ball is bouncing off into the distance. Turn motion tweening on in frame 1, with Ease Out if desired.

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