MACROMEDIA FLASH MX 2004-USING FLASH Use Manual page 125

Hide thumbs Also See for FLASH MX 2004-USING FLASH:
Table of Contents

Advertisement

italic = false
underline = false
url = ""
target = ""
align = "left"
leftMargin = 0
rightMargin = 0
indent = 0
leading = 0
bullet = false
tabStops = [] (empty array)
To create a dynamic text field:
Select a frame, button, or movie clip that will receive the action.
1.
Select Window > Development Panels > Actions to open the Actions panel if it isn't
2.
already open.
In the Actions toolbox, select the Built-in Classes category, then select the Movie category, then
3.
select the MovieClip category, and then select the Methods category. Finally, double-click the
createTextField
Select the placeholder
4.
will be the parent of the new text field. For this example, enter the alias _root because the main
Timeline is the parent.
Enter values for the following parameters:
5.
Instance Name
is a number that specifies the stacking order. For this example, enter 1.
Depth
is the x coordinate relative to the parent clip. For this example, enter 50.
X
is the y coordinate relative to the parent clip. For this example, enter 50.
Y
The following code is displayed in the Script pane:
_root.createTextField("mytext",1,50,50,200,100);
In the Actions toolbox, select the Built-in Classes category, then select the Movie category, then
6.
select the TextField category, and then select the Properties category. Finally, double-click the
property to create a new line. For this example, replace the placeholder
text
with myText in the Object parameter field.
In the Value field, enter this is my first text field object text. The following text is displayed in
7.
the Script pane:
mytext.text = "this is my first text field object text";
This example creates a text field with an instance name
height of 100, an x value of 50, and a y value of 50.
For a detailed description of the
"TextField class" in Flash ActionScript Language Reference.
method.
and enter an instance name or path for the movie clip that
instanceName
is the instance name of the new text field. For this example, enter myText.
createTextField
, a depth of 1, a width of 200, a
myText
method of the TextField object, see
Controlling text with ActionScript
instanceName
125

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash mx 2004 - actionscript

Table of Contents