This ActionScript code can be separated into five key sections. The first section of code
defines a new TextFormat instance that will be applied to a dynamically created text field.
The next two sections create two new text fields on the Stage. The first text field,
, applies the custom text formatting object created earlier, enables embedded
lorem_txt
fonts, and sets the
,displays the current sharpness and thickness values for the
debug_txt
field. The fourth section of code creates a LoadVars object, which is responsible for
loading the external text file and populating the
section of code defines a mouse listener that is called whenever the mouse pointer moves
on the Stage. The current values for
the current position of the mouse pointer on the Stage. The
properties are set for the
text field.
debug_txt
8.
Select Control > Test Movie to test the document.
Move the mouse pointer along the x axis to change the text field's sharpness. Move the
mouse pointer from left to right to cause the sharpness to increase and appear more
jagged. Move the mouse pointer along the y axis to cause the text field's thickness to
change.
For more information on using anti-alias text in a SWF file, see
ActionScript" on page
fit type" on page
417.
A sample file on your hard disk shows how to apply and manipulate anti-aliased text in an
application. You use the FlashType rendering technology to create small text that's highly
legible. This sample also demonstrates how text fields can scroll quickly and smoothly when
you use the
cacheAsBitmap
You can find the sample source file, flashtype.fla, in the Samples folder on your hard disk.
In Windows, browse to boot drive\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\ActionScript\FlashType.
On the Macintosh, browse to Macintosh HD/Applications/Macromedia Flash 8/Samples and
Tutorials/Samples/ActionScript/FlashType.
416
Working with Text and Strings
property to
antiAliasType
sharpness
text field, and the current values are displayed in the
lorem_txt
409,
"Font rendering options in Flash" on page
property.
. The second text field,
true
text field. The fifth, and final,
lorem_txt
and
are calculated based on
thickness
sharpness
"Setting anti-alias with
408, and
text
lorem_txt
and
thickness
"Using a grid
Need help?
Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?