184
Working with Text
Creating and removing text fields dynamically
You can use the
createTextField
method of the MovieClip object to create a new, empty
text field as a child of the movie clip that calls the method. You can use the
removeTextField
method to remove a text field created with
createTextField
; this method does not work on
a text field created manually in the Timeline.
When you create a text field, you can use the TextField object to set properties of the text
field. If you don’t set the properties, the new text field receives a set of default properties. The
default properties of the new text field are as follows:
type = "dynamic"
border = false
background = false
password = false
multiline = false
html = false
embedFonts = false
variable = null
maxChars = null
After you create a text field, you can use the TextFormat object to format the text. You must
create a new TextFormat object and then pass it as a parameter to the
setTextFormat
method
of the TextField object. A text field created with the
createTextField
method receives the
following default TextFormat object:
font = "Times New Roman"
size = 12
color = 0x000000
bold = false
italic = false
underline = false
url = ""
target = ""
align = "left"
leftMargin = 0
rightMargin = 0
indent = 0
leading = 0
bullet = false
tabStops = [] (empty array)
Summary of Contents for FLASH 8-FLASH
Page 1: ...Using Flash ...
Page 12: ...12 Contents ...
Page 110: ...110 Using Symbols Instances and Library Assets ...
Page 128: ...128 Working with Color Strokes and Fills ...
Page 156: ...156 Drawing ...
Page 190: ...190 Working with Text ...
Page 224: ...224 Working with Graphic Objects ...
Page 270: ...270 Creating Motion ...
Page 310: ...310 Working with Video ...
Page 362: ...362 Working with Screens Flash Professional Only ...
Page 386: ...386 Creating Multilanguage Text ...
Page 454: ...454 Data Integration Flash Professional Only ...
Page 500: ...500 Publishing ...
Page 534: ...534 Creating Accessible Content ...