Creating a Flash Document: Part 5
Adding text in Flash
Having constructed the visual elements of the interface it is time to add some text to the page. In Flash MX 2004 Professional you have three styles of text available to you.
The three styles are:
- Static: This is text that will not change. Use static text for such things as headlines, labels or descriptive text.
- Dynamic: This is text that sits in a document outside of the Flash file and is added or modified, programmatically, through the use of ActionScript. These fields can also be created with ActionScript.
- Input: As the name implies, this is the text a user would input. You can create and modify these fields programmatically as well as capture any text that may be input by the user. You see input text frequently used in forms and log in screens.
You can also change the type text field at any time by selecting the text field and changing its style through the use of the Text Style pop down menu in the Property Inspector.
When text is added to a Flash document you also have to decide whether the text being used will be displayed using embedded fonts of device fonts.
- Embedded fonts: The specified font is embedded into the SWF .The advantage here is the ability to use any font you own in the movie. The downside is the font will add to the size of the final file.
- Device Fonts: Device fonts are the fonts on the user’s computer. Using device fonts lowers the final file size but, if the font chosen is not installed on the user’s computer, a substitute font will be used.
Static text is always embedded into the .swf. Dynamic text and Input text require you to decide whether to use embedded fonts in your movie.
- Open the file you just saved and add a new layer named “TheLabtxt”.
- Select the text tool and click anywhere on the stage to create a text field.
- Enter “The Lab”.
- Use these values for the text in the Property inspector:
- Font: Times New Roman
- Weight: Bold
- Size: 24 points
- Colour: #730900
- Alignment : Left
- X= 410
- Y= 90
This text area will be used as the headline in the interface.
A good habit to develop with documents containing a number of layers is to add the nature of the content to the layer name. For example “TheLabtxt” tells you the content in that layer is text.
- Add a new Layer named “ExperimentTxt”. Select the text tool and enter the following: “The Experiments”. Drag the text to a position over the ExperBox layer.
- In the Property inspector, make sure the text is “Static Text” and then set the font to 20 point Arial, White (#FFFFFF)
- Open a Text Editor such as Notepad (PC) or TextEdit or SimpleText (Mac), open the “Lorem.txt” file in the Lesson Folder. When the file opens, select the text and copy it to the clipboard. Quit the text editor.
- In your Flash file, add a new layer named “DynamTxt”. Select the Text tool, click once on the layer and paste the text on the clipboard into the text box.
You can’t import text into Flash document. The only two methods are to Copy and Paste the text into a text field or to bring in the text programmatically such as using ActionScript to bring the text in from an XML document.
- Select the Text and ,using the Property inspector set the text as 12 point Arial and the text color to black:#000000.
- With the text still selected click the “Edit format options” button (It looks like a reversed “P”.) to open the Format Options. Set the Line spacing to 8 points and click OK. The text will spread out.
The Property inspector does not contain a leading option. In Flash, leading, the space between lines of text, is called Line spacing.
- With the text selected, set the text property in the Property inspector to Dynamic Text.
By formatting the text in the Dynamic text box, any text placed into it will be formatted with the text properties set in Steps 9 and 10.
Always look for visual clues when trying to determine whether text box you have selected on a page is Static or Dynamic. When you create a Dynamic or Input text box, the handle- the white box- is moved from the upper right corner to the lower right corner of the text box as shown below. Also, dynamic text has a dotted line around it when it isn’t selected on the stage.
- Click the text box and, using the selection handles, resize it to fit the interface.
- Select the Dynamic text box and, in the Property Inspector, click the Character button. When the Character Options dialog box opens, click “No Characters” and click OK to close the dialog box.
- Save the file.
When you see the Embed button in the Property Inspector you can decide whether or not to embed the fonts into the file. If fonts are to be embedded click the “Specify Ranges” button and select from the choices presented or enter the text to be included in the “Include these characters:” text input box


This work is licensed under a Creative Commons License.
