MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 555

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

lineTo(0, target_mc._height);
lineTo(0, 0);
endFill();
}
target_mc.setMask(maskClip);
target_mc._visible = true;
var mask_tween:Object = new Tween(maskClip, "_yscale", Strong.easeOut,
0, 100, 2, true);
};
this.createEmptyMovieClip("img_mc", 10);
var img_mcl:MovieClipLoader = new MovieClipLoader();
img_mcl.addListener(mclListener);
img_mcl.loadClip("http://www.helpexamples.com/flash/images/image1.jpg",
img_mc);
This code example imports the Tween class and each of the classes in the easing package.
Next, it creates an object that acts as the listener object for a MovieClipLoader instance
that's created in a later section of the code. The listener object defines a single event
listener,
onLoadInit
After the code repositions the image, a new movie clip instance is created within the
movie clip (which contains the dynamically loaded JPEG image). The
target_mc
Drawing API code draws a rectangle with the same dimensions as the JPEG image within
this new movie clip. The new movie clip masks the JPEG image by calling the
MovieClip.setMask()
Tween class to animate, which causes the image to slowly reveal itself.
3.
Save the Flash document and select Control > Test Movie to test the SWF file.
To animate
directly instead of the mask movie clip.
You can find a sample source file, drawingapi.fla, in the Samples folder on your hard disk,
which shows you how to use the Drawing API in a Flash application.
In Windows, browse to boot drive\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\ActionScript\DrawingAPI.
On the Macintosh, browse to Macintosh HD/Applications/Macromedia Flash 8/Samples
and Tutorials/Samples/ActionScript/DrawingAPI.
, which centers the dynamically loaded JPEG image on the Stage.
method. After the mask is drawn and set up, the mask uses the
in the previous example instead of
_alpha
, tween the
_yscale
target_mc
Drawing with ActionScript
555

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents