
270
USING FLASH CS4 PROFESSIONAL
Text
Import an XML file into the Strings panel
After you modify an XML file, if you place it in the folder specified in the Strings panel for that language, the XML file
is loaded into the Flash document (FLA file) when it opens.
Regardless of where the XML file you imported was located, when you save, test, or publish the FLA file, a folder for
each language in the Strings panel and an XML file for each language are created in the location indicated for
publishing SWF files. If no publish path is indicated, the folder and file are saved in the same folder in which the FLA
file is located. The XML files that the Strings panel generates are always populated with the information in the Strings
panel.
Alternatively, import an XML file into the Strings panel from another location. After you import it, when you save,
test, or publish the file, the XML file in the folder specified for that language is overwritten. You cannot import an XML
file for a language unless it is already selected as an available language in the Strings panel. You can also add a language
and import an XML file with the translation for that language.
1
Select Window
> Other Panels > Strings, and click Import XML.
2
In the Select a Language menu, select the language of the XML file you are importing, and click OK.
3
Navigate to the folder and XML file to import.
The XML information is loaded into the column in the Strings panel for the language you selected in step 3.
Note:
Select the same language in steps 2 and 3. Otherwise, you could, for example, import a French XML file into the
column for German.
See also
“
Publishing overview
” on page 379
Multilanguage text and ActionScript
You can control multilanguage text and import multilanguage XML files with ActionScript®.
Use ActionScript to load external files
To load existing XML data, or use a different format for the XML file, use the
loadVariables
action, the
getURL
action, the
LoadVars
object, or the
XML
object to create a document that contains multilanguage text by placing the
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
First Byte
Second Byte
UTF-16BE
OxFE
OxFF
UTF-16LE
OxFF
OxFE
Updated 5 March 2009