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.

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

See also<br />

attachMovie (MovieClip.attachMovie method)<br />

createTextField (MovieClip.createTextField method)<br />

public createTextField(instanceName:String, depth:Number, x:Number,<br />

y:Number, width:Number, height:Number) : TextField<br />

Creates a new, empty text field as a child of the movie clip on which you call this method. You<br />

can use the createTextField() method to create text fields while a SWF file plays. The<br />

depth parameter determines the new text field's depth level (z-order position) in the movie<br />

clip. Each depth level can contain only one object. If you create a new text field on a depth<br />

that already has a text field, the new text field replaces the existing text field. To avoid<br />

overwriting existing text fields, use MovieClip.getInstanceAtDepth() to determine<br />

whether a specific depth is already occupied, or MovieClip.getNextHighestDepth(), to<br />

determine the highest unoccupied depth. The text field is positioned at (x, y) with dimensions<br />

width by height. The x <strong>and</strong> y parameters are relative to the container movie clip; these<br />

parameters correspond to the _x <strong>and</strong> _y properties of the text field. The width <strong>and</strong> height<br />

parameters correspond to the _width <strong>and</strong> _height properties of the text field.<br />

The default properties of a text field are as follows:<br />

type = "dynamic"<br />

border = false<br />

background = false<br />

password = false<br />

multiline = false<br />

html = false<br />

embedFonts = false<br />

selectable = true<br />

wordWrap = false<br />

mouseWheelEnabled = true<br />

condenseWhite = false<br />

restrict = null<br />

variable = null<br />

maxChars = null<br />

styleSheet = undefined<br />

tabInded = undefined<br />

A text field created with createTextField() receives the following default TextFormat<br />

object settings:<br />

font = "Times New Roman" // "Times" on Mac OS<br />

MovieClip 415

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

Saved successfully!

Ooh no, something went wrong!