EasyManua.ls Logo

MACROMEDIA FLASH 8-USING FLASH - Page 376

MACROMEDIA FLASH 8-USING FLASH
678 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
376 Creating Multilanguage Text
To select the default language and automatic language detection:
1. Select Window > Other Panels > Strings to open the Strings panel.
2. Click the Settings button to display the Settings dialog box.
3. In the Default language pop-up menu, select the language you want to use for the default
language. This must be a language you have added as an available language.
4. If you want to enable automatic language detection, make sure that the Replace Strings
Automatically at Runtime check box is selected.
5. Click OK
Flash generates the following ActionScript, which stores the language XML file paths. You
can use this as a starting point for your own language detection script.
import mx.lang.Locale;
Locale.setFlaName("<flaFileName>");
Locale.setDefaultLang("langcode");
Locale.addXMLPath("langcode", "url/langcode/flaname_langcode.xml");
Using custom language detection
If you are an advanced Flash developer with knowledge of ActionScript, you can invoke text
replacement at a time that you designate, by creating your own custom component, or using
ActionScript to access the language XML files. For example, you might create a pop-up menu
that lets users select the language of their choice to view content.
For information on writing ActionScript to create custom language detection, see “About the
Strings panel in Chapter 12,Working with Text and Strings” in Learning ActionScript 2.0 in
Flash.
To select custom language detection:
1. Select Window > Other Panels > Strings to open the Strings panel.
2. Click the Settings button to display the Settings dialog box.
3. In the Default Language pop-up menu, select the language you want to use for the default
language. This must be a language you have added as an available language.
4. Select the Replace Strings via ActionScript check box.
NOTE
The ActionScript generated by the Strings panel does not use the Locale.initialize
function. You must decide how to call this function based on the language detection
customizations your project requires.

Table of Contents

Related product manuals