472
ActionScript classes
Example
The following example draws thre movie clip instances, using the
getNextHighestDepth()
method as the
depth
parameter of the
createEmptyMovieClip()
method, and labels each
movie clip them with its depth:
for (i = 0; i < 3; i++) {
drawClip(i);
}
function drawClip(n:Number):Void {
this.createEmptyMovieClip("triangle" + n, this.getNextHighestDepth());
var mc:MovieClip = eval("triangle" + n);
mc.beginFill(0x00aaFF, 100);
mc.lineStyle(4, 0xFF0000, 100);
mc.moveTo(0, 0);
mc.lineTo(100, 100);
mc.lineTo(0, 100);
mc.lineTo(0, 0);
mc._x = n * 30;
mc._y = n * 50
mc.createTextField("label", this.getNextHighestDepth(), 20, 50, 200, 200)
mc.label.text = mc.getDepth();
}
See also
getDepth (MovieClip.getDepth method)
,
getInstanceAtDepth
(MovieClip.getInstanceAtDepth method)
,
swapDepths (MovieClip.swapDepths
method)
,
attachMovie (MovieClip.attachMovie method)
,
duplicateMovieClip
(MovieClip.duplicateMovieClip method)
,
createEmptyMovieClip
(MovieClip.createEmptyMovieClip method)
getSWFVersion (MovieClip.getSWFVersion
method)
public getSWFVersion() : Number
Returns an integer that indicates the Flash Player version for the movie clip was published. If
the movie clip is a JPEG, GIF, or PNG file, or if an error occurs and Flash can't determine the
SWF version of the movie clip, -1 is returned.
You can extend the methods and event handlers of the MovieClip class by creating a subclass.
Availability:
ActionScript 1.0; Flash Lite 2.0
Summary of Contents for Flash Lite 2
Page 1: ...Flash Lite 2 x ActionScript Language Reference...
Page 22: ...22 Contents...
Page 244: ...244 ActionScript language elements...
Page 760: ...760 ActionScript classes...