User Guide
924 ActionScript classes
content.lineTo(0, 300);
content.lineTo(0, 0);
content.endFill();
content._rotation = -90;
mc.onEnterFrame = function() {
this.content._y += 1;
}
return mc;
}
The setUpContainer() function performs the following steps:
■ Create a MovieClip named container
■ Create a MovieClip named content inside of container
■ Draw a gradient shape inside of the content MovieClip
■ Return a reference to the container MovieClip
If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
MovieClip.getNextHighestDepth() method, which is
used in this example.
setMask (MovieClip.setMask method)
public setMask(mc:Object) : Void
Makes the movie clip in the parameter mc a mask that reveals the calling movie clip.
The
setMask() method allows multiple-frame movie clips with complex, multilayered
content to act as masks (which is possible by using mask layers). If you have device fonts in a
masked movie clip, they are drawn but not masked. You can't set a movie clip to be its own
mask; for example,
my_mc.setMask(my_mc).
If you create a mask layer that contains a movie clip, and then apply the
setMask() method
to it, the
setMask() call takes priority and this is not reversible. For example, you could have
a movie clip in a mask layer called
UIMask that masks another layer that contains another
movie clip called
UIMaskee. If, as the SWF file plays, you call UIMask.setMask(UIMaskee),
from that point on,
UIMask is masked by UIMaskee.
To cancel a mask created with ActionScript, pass the value
null to the setMask() method.
The following code cancels the mask without affecting the mask layer in the timeline.
UIMask.setMask(null);
You can extend the methods and event handlers of the MovieClip class by creating a subclass.
Availability: ActionScript 1.0; Flash Player 6