Use custom language detection

To access the language XML files to control text replacement at a time that you designate, create your own custom component or use ActionScript code. For example, you might create a pop‑up menu that lets users select a language for viewing content.

For information on writing ActionScript code to create custom language detection, see panel in Learning ActionScript 2.0 in Adobe Flash.

  1. Select Window > Other Panels > Strings, and click Settings.
  2. In the Default Language menu, select the default language.

    This must be a language you added as an available language.

  3. Select the Replace Strings Via ActionScript check box, and click OK.

    Flash generates the following ActionScript code, which stores the language XML file paths. Use this code 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");
Note: The ActionScript that the Strings panel generates does not use the Locale.initialize function. Decide how to call this function based on the language detection customizations your project requires.

  This page on the Web