03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

this.clear();<br />

};<br />

drawBox(box_mc, 10, 10, 320, 240);<br />

function drawBox(mc:MovieClip, x:Number, y:Number, w:Number, h:Number):Void<br />

{<br />

mc.lineStyle(0);<br />

mc.beginFill(0xEEEEEE);<br />

mc.moveTo(x, y);<br />

mc.lineTo(x+w, y);<br />

mc.lineTo(x+w, y+h);<br />

mc.lineTo(x, y+h);<br />

mc.lineTo(x, y);<br />

mc.endFill();<br />

}<br />

An example is also in the drawingapi.fla file in the ActionScript samples folder at<br />

www.adobe.com/go/learn_fl_samples. Download <strong>and</strong> decompress the .zip file <strong>and</strong> navigate to<br />

the folder for your version of ActionScript to access the sample.<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 />

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 />

414 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!