Creating Multilanguage Text > Creating movies with multilanguage text by loading external text or XML files |  |

Creating movies with multilanguage text by loading external text or XML files

You can create a movie containing multilanguage text by placing the text in an external text or XML file and loading the file into the movie at runtime, using the `loadVariables` action, the `getURL` action, the `LoadVars` object, or the `XML` object.

You should save the external file in UTF-8, 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 byte order mark (BOM) to identify the encoding format to the Flash Player 6. See Unicode encoding formats supported by the Flash Player 6.

Note: If the external file is an XML file, you cannot use an XML encoding tag to change the encoding of the file. You should save the file in a supported Unicode format. See About encoding in external XML files.

To include multilanguage text using an externally loaded file:

1 | In the Flash MX authoring tool, create a dynamic or input text field that will display the text in the movie. For more information, see Working with Text.
2 | Assign a variable to the text field, for example, `myTextField`.
3 | Create a text or XML file that defines the value for the text filed variable.
4 | Save the file in UTF-8, UTF-16BE, or UTF-16LE format.
5 | If you are using a UTF-16 format, make sure a byte order mark is included at the beginning of the file to identify the encoding:
| For UTF-16BE, the first byte of the file should be OxFE, and the second byte should be OxFF.
| For UTF-16LE, the first byte of the file should be OxFF, and the second byte should be OxFE.
| Note: Most text editors that can save files in UTF-16BE or LE automatically add the BOMs to the files.
6 | Use one of the following ActionScript procedures to reference the external file and load it into the dynamic or input text field:
| Use the `loadVariables` action to load an external file.
| Use the `getURL` action to load an external file from a specified URL.
| Use the `LoadVars` object (a predefined client-server object) to load an external text file from a specified URL.
| Use the `XML` object (a predefined client-server object) to load an external XML file from a specified URL.
| For information on these procedures, see the respective entries in the online ActionScript Dictionary (Help > ActionScript Dictionary) or in the Reference panel (Window > Reference).