Description
Method; creates a new, empty text field as a child of the movie clip specified by
use
createTextField()
(
,
) with dimensions
x
y
movie clip; these parameters correspond to the
and
parameters correspond to the
height
The default properties of a text field are as follows:
type = "dynamic"
border = false
background = false
password = false
multiline = false
html = false
embedFonts = false
variable = null
maxChars = null
A text field created with
font = "Times New Roman"
size = 12
textColor = 0x000000
bold = false
italic = false
underline = false
url = ""
target = ""
align = "left"
leftMargin = 0
rightMargin = 0
indent = 0
leading = 0
bullet = false
tabStops = [] (empty array)
Example
The following example creates a text field with a width of 300, a height of 100, an x coordinate of
100, a y coordinate of 100, no border, red, and underlined text.
_root.createTextField("mytext",1,100,100,300,100);
mytext.multiline = true;
mytext.wordWrap = true;
mytext.border = false;
myformat = new TextFormat();
myformat.color = 0xff0000;
myformat.bullet = false;
myformat.underline = true;
mytext.text = "this is my first test field object text";
mytext.setTextFormat(myformat);
See also
TextFormat class
to create text fields while a SWF file plays. The text field is positioned at
by
. The
width
height
_width
createTextField()
and
parameters are relative to the container
x
y
and
properties of the text field. The
_x
_y
and
properties of the text field.
_height
receives the following default TextFormat object:
MovieClip.createTextField()
. You can
my_mc
width
495
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?
Questions and answers