In the Actions panel, the following code is placed on Frame 1 of the Timeline:
flower_maskee.setMask(oval_mask);
When you test the document (Control > Test Movie), the maskee is alpha blended by using
the mask.
Mask layers do not support alpha channel masking. You must use ActionScript code to
apply a mask, and use runtime bitmap caching.
Handling movie clip events
Movie clips can respond to user events, such as mouse clicks and keypresses, as well as system-
level events, such as the initial loading of a movie clip on the Stage. ActionScript provides two
ways to handle movie clip events: through event handler methods and
event handlers. For more information on handling movie clip events, see
on()
"Handling
Events.".
Assigning a class to a movie clip symbol
Using ActionScript 2.0, you can create a class that extends the behavior of the built-in
MovieClip class and then use the Linkage Properties dialog box to assign that class to a movie
clip library symbol. Whenever you create an instance of the movie clip to which the class is
assigned, it assumes the properties and behaviors defined by the class assigned to it. (For more
information about ActionScript 2.0, see
In a subclass of the MovieClip class, you can provide method definitions for the built-in
MovieClip methods and event handlers, such as
following procedure, you'll create a class called MoveRight that extends the MovieClip class;
MoveRight defines an
the user clicks the movie clip. In the second procedure, you'll create a movie clip symbol in a
new Flash (FLA) document and assign the MoveRight class to that symbol.
To create a movie clip subclass:
1.
Create a new directory called BallTest.
2.
Select File > New, and select ActionScript file from the list of document types to create a
new ActionScript file.
378
Working with Movie Clips
"Example: Writing custom classes" on page
handler that moves the clip 20 pixels to the right whenever
onPress
and
onEnterFrame
onRelease
and
onClipEvent()
Chapter 10,
263.)
. In the
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?