You can extend the methods and event handlers of the MovieClip class by creating a subclass.
Availability: ActionScript 1.0; Flash Player 6
Parameters
- A string that identifies the instance name of the new movie clip.
name:String
- An integer that specifies the depth of the new movie clip.
depth:Number
Returns
- A reference to the newly created movie clip.
MovieClip
Example
The following example creates an empty MovieClip named
, creates a new
container
TextField inside of it, and then sets the new
property.
TextField.text
var container:MovieClip = this.createEmptyMovieClip("container",
this.getNextHighestDepth());
var label:TextField = container.createTextField("label", 1, 0, 0, 150, 20);
label.text = "Hello World";
The
method used in this example requires Flash Player
MovieClip.getNextHighestDepth()
7 or later. If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
method.
MovieClip.getNextHighestDepth()
See also
attachMovie (MovieClip.attachMovie method)
MovieClip
849
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?