Adobe Flash

Create a dynamic text field

Dynamic text can display text from external sources at runtime. Next, you'll create a dynamic text field that links to an external text file. The external text file you'll use is named safetyFeatures.txt. It is in the same folder as the lesson FLA file. The FLA file already contains ActionScript that displays the text when you test or publish the document.

In the Timeline, select the Dynamic Text layer. Use the Selection tool to click in the workspace, and to deselect any objects.

Select the Text tool in the Tools panel.

In the text Property inspector, set the following options:

  • Select Dynamic Text from the Text Type pop-up menu.

  • For Text Attributes, set Verdana as the text type, with a font size of 6.

  • For Line Type, select Multiline to ensure the text wraps correctly.

  • Click the text color box and select a dark shade of gray.

  • Select Align Left as a paragraph attribute, if it isn't already selected.

On the Stage, drag to create a text field in the area between the two horizontal rules.

In the Instance Name text box of the Property inspector, name the dynamic text field newFeatures_txt.

The ActionScript in this document loads an external text file, which is in the same folder as your document. The ActionScript is set up to load the text into a field named newFeatures_txt.

Specify format options

The Format Options dialog box allows you to specify margin and indentation settings for the text.

With the dynamic text field still selected on the Stage, click Format in the Property inspector.

In the Left Margin text box, enter 5, and in the Right Margin text box, enter 5. Then click OK.

The dynamic text now has 5-pixel left and right margins within the text field.

by BrainBellupdated