Multilanguage Text And Actionscript - Adobe 38039336 - Flash CS3 Professional User Manual

User guide
Hide thumbs Also See for 38039336 - Flash CS3 Professional:
Table of Contents

Advertisement

See also
"Publishing overview" on page 419

Multilanguage text and ActionScript

Use ActionScript to load external files
To load existing XML data, or use a different format for the XML file, use the
action, the
object, or the
LoadVars
text in an external text or XML file and loading the file into the movie clip at runtime.
Save the external file in UTF-8 (recommended), UTF-16BE, or UTF-16LE format, using an application that supports
the format. If you are using UTF-16BE or UTF-16LE format, the file must begin with a BOM to identify the encoding
format to Flash Player. The following table lists the BOM to include to identify the encoding:
Note: Most text editors that can save files in UTF-16BE or LE automatically add the BOMs to the files.
UTF Format
UTF-16BE
UTF-16LE
Note: If the external file is an XML file, you cannot use an XML encoding tag to change the file encoding. Save the file
in a supported Unicode format.
1
In the Flash authoring application, create a dynamic or input text field to show the text in the document.
In the Property inspector, with the text field selected, assign an instance name to the text field.
2
3
Outside of Flash, create a text or XML file that defines the value for the text field variable.
Save the XML file in UTF-8 (recommended), UTF-16BE, or UTF-16LE format.
4
Use one of the following ActionScript procedures to reference the external file and load it into the dynamic or
5
input text field:
• Use the
loadVariables
• Use the
action to load an external file from a specified URL.
getURL
• Use the
object (a predefined client-server object) to load an external text file from a specified URL.
LoadVars
• Use the
object (a predefined client-server object) to load an external XML file from a specified URL. For more
XML
information, see XML in the ActionScript 2.0 Language Reference.
See also
"Using the XMLConnector component to connect to external XML files" on page 291
"Unicode and Flash Player" on page 281
"Working with text" on page 261
Create multilanguage documents using the #include action
To create a document that contains multiple languages, use the
object to create a document that contains multilanguage text by placing the
XML
First Byte
OxFE
OxFF
action to load an external file.
loadVariables
Second Byte
OxFF
OxFE
action.
#include
FLASH CS3
User Guide
action, the
getURL
289

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash cs3 professional

Table of Contents