TextField

A display object that handles texts.

new TextField()

Methods

addEventListener(type, callback)

Registers an event listener object to EventDispatcher object so that the listener receives the notification.

Parameters:
Name Type Description
type String The type of event.
callback Function The listener function.

dispatchEvent(Event)

Dispatches an event to the event flow.

Parameters:
Name Type Description
Event arc.Event object

getAlignX() → {Number}

Returns a horizontal position from the origin.

Returns:
Number A horizontal position from the origin

getAlignY() → {Number}

Returns a vartical position from the origin.

Returns:
Number A vartical position from the origin

getAlpha() → {Number}

Gets the alpha.

Returns:
Number An alpha

getHeight() → {Number}

Returns the height.

Returns:
Number A height

getParent() → {DisplayObject}

Returns the parent of this display object.

Returns:
DisplayObject The parent

getRotation() → {Number}

Returns the rotation.

Returns:
Number A rotation in degree

getScaleX() → {Number}

Returns the horizontal scale.

Returns:
Number A horizontal scale

getScaleY() → {Number}

Returns the vartical scale.

Returns:
Number A vartical scale

getStage()

Returns a Stage object.

getVisible() → {Boolean}

Returns the visibility.

Returns:
Boolean A visibility

getWidth() → {Number}

Returns the width.

Returns:
Number A width

getX() → {Number}

Returns the horizontal position.

Returns:
Number A horizontal position

getY() → {Number}

Returns the vartical position.

Returns:
Number A vartical position

globalToLocal(x, y) → {Array}

Converts global positions to local positions.

Parameters:
Name Type Description
x Number A global horizontal position
y Number A global vartical position
Returns:
Array An array that includes local positions of x and y in [x, y].

localToGlobal(x, y) → {Array}

Converts local positions to global positions.

Parameters:
Name Type Description
x Number A local horizontal position
y Number A local vartical position
Returns:
Array An array that includes global positions of x and y in [x, y].

removeEventListener(type, callback)

Removes a listener from the EventDispatcher object.

Parameters:
Name Type Description
type String The type of event.
callback Function The listener function.

setAlign(align)

Sets an align of the text.

Parameters:
Name Type Description
align String

setAlpha(An)

Sets an alpha.

Parameters:
Name Type Description
An Number alpha

setColor(color)

Sets a color of the texts.

Parameters:
Name Type Description
color int A color in hex

setFont(family, size, isBold)

Sets a font of the texts.

Parameters:
Name Type Description
family String A font family
size Number A size of the font
isBold Boolean If true the text is bold

setHeight(height)

Sets a height.

Parameters:
Name Type Description
height Number A height

setRotation(A)

Sets a rotation.

Parameters:
Name Type Description
A Number rotation in degree

setScaleX(scaleX)

Sets a horizontal scale.

Parameters:
Name Type Description
scaleX Number A horizontal scale

setScaleY(scaleX)

Sets a vartical scale.

Parameters:
Name Type Description
scaleX Number A vartical scale

setText(text)

Sets texts.

Parameters:
Name Type Description
text String Texts that is going to be shown

setVisible(A)

Sets a visibility.

Parameters:
Name Type Description
A Boolean visibility

setWidth(width)

Sets a width.

Parameters:
Name Type Description
width Number A width

setX(x)

Sets a horizontal position.

Parameters:
Name Type Description
x Number A horizontal position

setY(y)

Sets a vartical position.

Parameters:
Name Type Description
y Number A vartical position