03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The MovieClip.getNextHighestDepth() method used in this example requires Flash Player<br />

7 or later. If your SWF file includes a version 2 component, use the version 2 components'<br />

DepthManager class instead of the MovieClip.getNextHighestDepth() method.<br />

For another example, see the Flash Samples page at www.adobe.com/go/learn_fl_samples.<br />

Download <strong>and</strong> decompress the Samples zip file <strong>and</strong> go to the <strong>ActionScript</strong><strong>2.0</strong>\DrawingAPI<br />

folder to access the drawingapi.fla file.<br />

See also<br />

lineStyle (MovieClip.lineStyle method)<br />

createEmptyMovieClip<br />

(MovieClip.createEmptyMovieClip method)<br />

public createEmptyMovieClip(name:String, depth:Number) : MovieClip<br />

Creates an empty movie clip as a child of an existing movie clip. This method behaves<br />

similarly to the attachMovie() method, but you don't need to provide an external linkage<br />

identifier for the new movie clip. The registration point for a newly created empty movie clip<br />

is the upper-left corner. This method fails if any of the parameters are missing.<br />

You can extend the methods <strong>and</strong> event h<strong>and</strong>lers of the MovieClip class by creating a subclass.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 6<br />

Parameters<br />

name:String - A string that identifies the instance name of the new movie clip.<br />

depth:Number - An integer that specifies the depth of the new movie clip.<br />

Returns<br />

MovieClip - A reference to the newly created movie clip.<br />

Example<br />

The following example creates an empty MovieClip named container, creates a new<br />

TextField inside of it, <strong>and</strong> then sets the new TextField.text property.<br />

var container:MovieClip = this.createEmptyMovieClip("container",<br />

this.getNextHighestDepth());<br />

var label:TextField = container.createTextField("label", 1, 0, 0, 150, 20);<br />

label.text = "Hello World";<br />

The MovieClip.getNextHighestDepth() method used in this example requires Flash Player<br />

7 or later. If your SWF file includes a version 2 component, use the version 2 components'<br />

DepthManager class instead of the MovieClip.getNextHighestDepth() method.<br />

MovieClip 861

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!