EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - Page 486

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
830 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
486 Animation, Filters, and Drawings
9. With the image still selected, open the Property inspector (Window > Properties >
Properties), and assign the movie clip the instance name img1_mc.
10. Select Frame 1 of the main Timeline and add the following ActionScript to the
Actions panel:
mx.transitions.TransitionManager.start(img1_mc,
{type:mx.transitions.Zoom, direction:0, duration:1,
easing:mx.transitions.easing.Bounce.easeOut, param1:empty,
param2:empty});
11.
Select Control > Test Movie to test the animation.
The image grows and has a slight bouncing effect before it returns to its original size. If the
animation moves too quickly, increase the animations duration (in the previous code
snippet) from one second to two or three seconds (for example,
duration:3).
You might notice that the image is anchored in the upper-left corner and grows toward the
lower-right corner. This is different from the preview you see in the Transitions
dialog box.
Creating complex animations is easy using the Tween and TransitionManager classes and
doesnt require you to create motion or shape tweens on the timeline. Most importantly,
you dont need to write complex math to create easing methods. If you want images to
zoom in from the center instead of anchoring on a corner, modify the symbol’s
registration point when you convert the image from a bitmap into a symbol.
To zoom images in from the center of the image:
1. Complete the steps in the previous procedure.
2. Open the zoom.fla file, and select File > Save As to save a new copy of the document.
Save the file as zoom2.fla.
3. Drag a copy of the bitmap symbol from the Library panel onto the Stage beside the current
movie clip symbol.
4. With the bitmap image still selected on the Stage, press F8 to convert the symbol into a
movie clip.
Name the symbol img2.
NOTE
For information on working with packages, see “Working with filter packages”
on page 499.

Table of Contents

Related product manuals