|
|
Creating text
About text fieldsYou can create three types of text fields: static, dynamic,
and input. All text fields support Unicode.
Static text fields display text that doesn’t change characters
dynamically.
Dynamic text fields display dynamically updating text, such
as stock quotes or weather reports.
Input text fields allow users to enter text in forms or surveys.
You
can create horizontal text (with a left-to-right flow) or static
vertical text (with either a right-to-left or left-to-right flow).
When
creating static text, you can place text on a single line that expands
as you type, or in a fixed-width field (for horizontal text) or
fixed-height field (for vertical text) that expands and wraps words
automatically. When creating dynamic or input text, you can place
text on a single line, or create a text field with a fixed width
and height.
Flash displays a handle on the corner
of a text field to identify the type of text field:
For static horizontal text that extends, a round handle appears
at the upper-right corner of the text field.
For static horizontal text that has a fixed width, a square
handle appears at the upper-right corner of the text field.
For static vertical text that has right-to-left flow and
extends, a round handle appears at the lower-left corner of the
text field.
For static vertical text that has right-to-left flow and
a fixed height, a square handle appears at the lower-left corner
of the text field.
For static vertical text that has left-to-right flow and
extends, a round handle appears at the lower-right corner of the
text field.
For static vertical text that has left-to-right flow and
a fixed height, a square handle appears at the lower-right corner
of the text field.
For dynamic or input text fields that extend, a round handle
appears at the lower-right corner of the text field.
For dynamic or input text that has a defined height and width,
a square handle appears at the lower-right corner of the text field.
For dynamic scrollable text fields, the round or square handle
becomes solid black instead of hollow.
Shift-double-click
the handle of dynamic and input text fields to create text fields
that don’t expand when you enter text on the Stage. This allows
you to create a text field of a fixed size and fill it with more
text than it can display to create scrolling text.
After
you use the Text tool to create a text field, use the Property inspector
to specify the type of text field, and to set values that control
how the text field and its contents appear in the SWF file.
Create and edit text fieldsText
is horizontal by default. However, static text can also be aligned
vertically.
You
can use most common word-processing techniques to edit text in Flash. Use the Cut, Copy, and Paste
commands to move text in a Flash file
as well as between Flash and other
applications.
Add text to the Stage- Select the Text tool
.
- In the Property inspector (Window > Properties),
select a text type from the pop‑up menu to specify the type of text
field:
- Dynamic Text
- Creates a field that displays dynamically updating text.
- Input Text
- Creates a field in which users can enter text.
- Static Text
- Creates a field that cannot update dynamically.
- For
static text only: In the Property inspector, click Change Orientation
Of Text
and
select a direction for text orientation and flow. (Horizontal is
the default setting.)
- On the Stage, do one of the following:
To create a text field that displays
text in a single line, click where you want the text to start.
To
create a text field with a fixed width (for horizontal text) or
fixed height (for vertical text), position the pointer where you
want the text to start and drag to the desired width or height.
Note: If you create a text field that extends past the edge
of the Stage as you type, the text isn’t lost. To make the handle
accessible again, add line breaks, move the text field, or select
View > Pasteboard.
- Select text attributes in the Property inspector.
Change the size of a text field Drag the text field’s resize handle. When text is selected, a blue bounding box lets you resize
the text field by dragging one of its handles. Static text fields
have four handles that let you resize the text field horizontally.
Dynamic text fields have eight handles that let you resize the text
field vertically, horizontally, or diagonally.
Switch a text field between fixed-width (or fixed-height) and extending Double-click a resize handle.
Select characters in a text field- Select the Text tool
.
- Do one of the following:
Drag to select characters.
Double-click to select a word.
Click to specify the beginning of the selection,
and Shift-click to specify the end of the selection.
Press Control+A (Windows) or Command+A (Macintosh)
to select all the text in the field.
Select text fields Using
the Selection tool , click
a text field. Shift-click to select multiple text fields.
Set dynamic and input text options- Click
in an existing dynamic text field.
- In the Property inspector, make sure Dynamic or Input
is displayed in the pop‑up menu.
- Enter an instance name for the text field.
- Specify the height, width, and location of text.
- Select the font and style.
- In the Paragraph section
of the Property inspector, specify one of the following options
from the Behavior menu:
- Single line
- Displays the text as one line.
- Multiline
- Displays the text in multiple lines.
- Multiline No Wrap
- Displays text in multiple lines that break only if the
last character is a breaking character, such as Enter (Windows)
or Return (Macintosh).
- To
enable users to select dynamic text, click Selectable
. Deselect
this option to prevent users from selecting dynamic text.
- To preserve rich text formatting
(such as fonts and hyperlinks) with the appropriate HTML tags, click
Render Text As HTML
.
- To display a black border and white
background for the text field, click Show Border Around Text
.
- (Optional)
In the Var box, enter the variable name for the text field. (Use
this option only when authoring for Macromedia Flash Player 5 from
Adobe or earlier.)
Beginning with Macromedia Flash MX (version 6), you assign
the text field an instance name using the Property inspector. Although
you can use the variable name method with dynamic text fields for
backwards compatibility to Macromedia Flash 5 and earlier versions,
Adobe doesn't recommend this, because you can't control other text
field properties, or apply style sheet settings.
- Click Character Embedding for embedded font outline options:
- Don’t embed
- Specifies that no fonts be embedded.
- Auto fill
- Click Auto Fill to embed all of the characters from the
selected text field.
Set preferences for vertical text- Select
Edit > Preferences (Windows) or Flash >
Preferences (Macintosh) and click the Text category in the Preferences
dialog box.
- Under Vertical Text, set any of these options:
- Default Text Orientation
- Automatically
gives new text fields vertical orientation.
- Right to Left Text Flow
- Makes lines of vertical text fill the page from right
to left.
- No Kerning
- Prevents kerning from being applied to vertical text.
(Kerning remains enabled for horizontal text.)
Check spellingYou can check spelling in text throughout
your Flash document. You can also customize
the spell checker.
Use the spell checker- Select
Text > Check Spelling to view the Check Spelling dialog
box.
The box in the upper-left corner identifies words not found
in the selected dictionaries, and also identifies the type of element
that contains the text (such as a text field or frame label).
- Do one of the following:
Click Add To Personal to add the word to
your personal dictionary.
Click Ignore to leave the word unchanged. Click
Ignore All to leave all occurrences of the word in the document
unchanged.
Enter a word in the Change To box or select a word
from the Suggestions scroll list. Then click Change to change the
word or click Change All to change all occurrences of the word in
the document.
Click Delete to delete the word from the document.
- To end the spelling check, do one of the following:
Click Close to end spelling before Flash reaches the end of the document.
Continue checking spelling until you see a notification
that Flash has reached the end of the
document, then click No to end spelling checking. (Click Yes to
continue the spelling check at the beginning of the document.)
Customize the spelling checker- Do
one of the following:
Select Text > Spelling Setup.
(Use this option if you have not used the Check Spelling feature
before.)
In the Check Spelling dialog box (Text >
Check Spelling), click Setup.
- Set any of the following options:
- Document Options
- Use these options to specify which elements are to be checked.
- Dictionaries
- Lists the built-in dictionaries. You must select at least
one dictionary to enable spelling checking.
- Personal Dictionary
- Enter a path or click the folder icon and browse to a document
to use as a personal dictionary. (You can modify this dictionary.)
- Edit Personal Dictionary
- Adds words and phrases to your personal dictionary. In
the Personal Dictionary dialog box, enter each new item on a separate
line in the text field.
- Checking Options
- Use these options to control how Flash handles specific
types of words and characters when checking spelling.
Find and replace text- Select Edit > Find
and Replace.
- Select Text from the For pop‑up menu.
- In the Text box, enter the text to find.
- In the Replace With Text box, enter the text to replace
the existing text.
- Select options for searching text:
- Whole Word
- Searches for the specified text string as a whole word
only, bounded on both sides by spaces, quotes, or similar markers.
When Whole Word is deselected, the specified text can be searched
as part of a larger word. For example, when Whole Word is deselected,
a search for place will yield the words replace, placement,
and so on.
- Match Case
- Searches for text that exactly matches the case (uppercase
or lowercase character formatting) of the specified text when finding
and replacing.
- Regular Expressions
- Allows the use of regular expressions to perform complex searches
in text fields and ActionScript. For information about using regular expressions,
see these resources:
Introduction to Regular Expressions This
article describes using regular expressions in the Find and Replace
dialog box. It is written about Dreamweaver, but applies equally
to Flash.
Using
regular expressions in Programming Actionscript 3.0.
This chapter describes using regular expressions to perform searches
using ActionScript 3.0.
- Text Field Contents
- Searches the contents of a text field.
- Frames/Layers/Parameters
- Searches frame labels, layer names, scene names, and
component parameters.
- Strings in ActionScript
- Searches strings (text between quotation marks) in ActionScript
in the document or scene (external ActionScript files are not searched).
- ActionScript
- Searches all ActionScript, including code and strings.
- To select the next occurrence of the specified text on
the Stage and edit it in place, select Live Edit.
Note: Only the next occurrence is selected for live editing,
even if you select Find All in step 7.
- To find text, do one of the following:
To find the next occurrence of the specified
text, click Find Next.
To find all occurrences of the specified text, click
Find All.
- To replace text, do one of the following:
To replace the currently selected occurrence
of the specified text, click Replace.
To replace all occurrences of the specified text,
click Replace All.
Embed and share fontsYou
can embed a font in your SWF file so that the font does not need
to be present on the devices the SWF file eventually plays back
on. To embed a font, create a font library item.
Creating
a font library item also allows you to use the font as a shared
library item for sharing among multiple SWF files. You must also
assign the font item a linkage identifier string and a URL where
the document that contains the font symbol will be posted. In this
way, you can link to the font and use it in a Flash application. When you use font
symbols for dynamic or input text, embed the font outline information.
After
a font symbol in a Flash document has
an assigned identifier string and URL, use the font symbol in another Flash document by copying the font
symbol into the destination FLA file.
Create a font library item- Open the library to add a font symbol
to.
- Select
New Font from the Library Panel menu.
- Enter a name for the font item in the Name text field.
- Select a font family from the Font menu or enter the
name of a font in the Font text field.
- (Optional) Select a font style from the Style menu.
If the selected font does not include a bold or italic
style, you can select the Faux Bold or Faux Italic checkboxes. Faux
Bold and Faux Italic styles are added to the Regular style by the
operating system. The faux styles may not look as good as fonts
that include a true bold or italic style.
- (Optional) To embed the font information as bitmap data
rather than vector outline data, select the Bitmap Text option,
and enter a font size in the Size text field. (Bitmap fonts cannot
use anti-aliasing. You must choose Bitmap as the anti-aliasing option
in the Property inspector for text that uses this font.)
Note: The Size setting applies only when you use the Bitmap
Text option.
Assign an identifier string to a font library item- Select the font item in the Library panel.
- Select Properties from the Library Panel menu.
- Under Linkage, select Export for Runtime
Sharing.
- In the Identifier text field, enter a string to identify
the font item.
- In the URL text field, enter the URL of the SWF file
that contains the font item.
Scrolling textThere
are several ways to create scrolling text in Flash: Make dynamic or input
text fields scrollable by using menu commands or the text field
handle. This does not add a scrollbar to the text field, but instead allows
the user to scroll the text with the arrow keys (for text fields
also set to Selectable) or the mouse wheel. The user must first
click the text field to give it focus.
Add an ActionScript 3.0 UIScrollbar component to a text field
to make it scroll. For more information, see “Use the UIScrollBar
component” in Using ActionScript 3.0 Components.
In ActionScript 3.0, use the scrollH and scrollV properties
of the TextField class.
Add an ActionScript 2.0 ScrollBar component to a text field
to make it scroll. For more information, see “UIScrollBar Component”
in the ActionScript 2.0 Components Language Reference.
In ActionScript 2.0, use the TextField object’s scroll and maxscroll properties
to control vertical scrolling and the hscroll and maxhscroll properties
to control horizontal scrolling in a text field. See Example: Creating scrolling
text in Learning ActionScript 2.0 in Adobe Flash.
Make dynamic text scrollable Do one of the following:Shift-double-click the lower-right handle
on the dynamic text field. The handle will turn from an unfilled
square (non-scrollable) to a filled square (scrollable).
Using the Selection tool , select
the dynamic text field and then select Text > Scrollable.
Select the dynamic text field with the Selection
tool. Right-click (Windows) or Control-click (Macintosh) the dynamic
text field and select Scrollable from the context menu.
Transforming textYou
can create text effects by transforming text fields. For example,
you can rotate, skew, flip, and scale text fields. (When you scale
a text field as an object, the Property inspector does not reflect
increases or decreases in point size.) The text in a transformed
text field can still be edited, although severe transformations
may make it difficult to read.
You can also animate text by using Timeline effects. For example,
you can make text bounce, fade in or out, or explode.
Break text apartYou can break apart text
to place each character in a separate text field. Then you can quickly
distribute the text fields to separate layers and animate each field. However,
you cannot break apart text in scrollable text fields.
You
can also convert the text to its component lines and fills to reshape,
erase, and otherwise manipulate it as a graphic. As with any other
shape, you can individually group these converted characters, or
change them to symbols and animate them. After you convert text
to graphic lines and fills, you can no longer edit the text.
Note: The
Break Apart command applies only to outline fonts such as TrueType
fonts. Bitmap fonts disappear from the screen when you break them
apart. PostScript fonts can be broken apart only on Macintosh systems.
- Using the Selection tool
, click
a text field.
- Select Modify > Break Apart.
Each character in the selected text is placed in a separate
text field. The text remains in the same position on the Stage.
- Select
Modify > Break Apart again to convert the characters
to shapes on the Stage.
Link horizontal text to a URL- Select
text or a text field:
Use the Text tool to
select text in a text field.
To link all the text in a text field, use the Selection
tool to
select a text field.
- In the Link text field in the Options section of the
Property inspector (Window > Properties), enter the
URL to which you want to link the text field.
Note: To
create a link to an e-mail address, use the mailto: URL. For example,
enter mailto:adamsmith@example.com.
Substituting missing fontsIf you work with a document that contains
fonts that aren’t installed on your system, Flash uses
the fonts available on your system. You can select which fonts are
substituted for the missing fonts, or you can let Flash substitute missing fonts with
the Flash System Default Font.
When
a font is substituted, the text is displayed on your system using
the substitute font, but the missing font information is saved with
the document. If the document is reopened on a system that includes
the missing font, the text is displayed in that font.
When
you work with a document that includes missing fonts, the missing
fonts appear in the font list in the Property inspector. When you
select substitute fonts, the substitute fonts names also appear,
enclosed in parentheses to identify them as substitute fonts.
If
you apply formatting (such as font size or kerning) to the substitute
font, check the formatting when the text is displayed in the missing
font, because it may not look as expected.
If you install
a previously missing font on your system and restart Flash, the font is displayed in documents
that use the font, and the font is removed from the Missing Fonts
dialog box.
If you see an alert box indicating missing fonts
in a document, you can select substitute fonts in the Font Mapping
dialog box.
Specify font substitution- When
the Missing Fonts alert appears, do one of the following:
Click Select Substitute Fonts to select
substitute fonts from fonts installed on your system and proceed
to step 2.
Click Use Default to use the Flash System Default Font to substitute
all missing fonts and to dismiss the Missing Fonts alert. You have finished
specifying font substitution.
- In the Font Mapping dialog box, click a font in the Missing
Fonts column to select it. Shift‑click to select multiple missing
fonts to map them all to the same substitute font.
The default substitute fonts are displayed in the Mapped
To column, until you select substitute fonts.
- Select a font from the Substitute Font pop‑up menu.
- Repeat steps 2 through 3 for all missing fonts.
View all the missing fonts in a document and reselect substitute fonts- With
the document active in Flash, select
Edit > Font Mapping (Windows) or Flash >
Font Mapping (Macintosh).
- Click a font in the Missing Fonts column to select it.
Shift‑click to select multiple missing fonts to map them all to
the same substitute font.
The default substitute fonts are displayed in the Mapped
To column, until you select substitute fonts.
- Select a font from the Substitute Font pop‑up menu.
- Repeat steps 2 through 3 for all missing fonts.
View or delete font mappings- Close
all documents in Flash.
- Select Edit > Font Mapping.
- To delete a font mapping, select the mapping and press
Delete.
Turn off the Missing Fonts alertTo turn the alert off for the current
document, in the Missing Fonts alert box select Don’t Show Again
For This Document, Always Use Substitute Fonts. Select Edit >
Font Mapping to view mapping information for the document again.
|