MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 393

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

You can find sample source files that demonstrate how to work with text fields using
ActionScript. The source files are called loadText.fla and formattedText.fla, and you can find
them in the Samples folder on your hard disk:
In Windows, browse to boot drive\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\ActionScript\LoadText.
On the Macintosh, browse to Macintosh HD/Applications/Macromedia Flash 8/Samples
and Tutorials/Samples/ActionScript/LoadText.
You can also find a source file that loads text and applies anti-alias formatting in addition to
bitmap caching. The sample source file is called 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.
Using FlashVars to load and display text
Using FlashVars is simple, but requires you to publish your SWF files along with HTML
documents. You modify the generated HTML code and include the FlashVars properties in
both the
and
object
modified HTML document in your web browser.
To use FlashVars to pass variables from HTML to your Flash document:
1.
Create a new Flash document and save it as flashvars.fla.
2.
Add the following ActionScript to Frame 1 of the Timeline:
this.createTextField("my_txt", 10, 10, 10, 100, 21);
my_txt.text = _level0.username;
3.
Save the Flash document and select File > Publish to generate the HTML and SWF files.
An HTML document publishes, by default, to the same directory as your FLA file. If
an HTML document does not publish, select File > Publish Settings and then select
the Formats tab. Make sure that you select HTML.
4.
Open up the flashvars.html document in a text or HTML editor.
tags. You can then test the Flash document by viewing the
embed
About loading text and variables into text fields
393

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

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?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents