initialize (Locale.initialize method)

public static initialize() : Void

Automatically determines the language to use and loads the XML language file. This is primarily used by Flash when the strings replacement method is "automatically at runtime".

Availability: ActionScript 2.0; Flash Player 7

Example

This example shows how to use the initialize() method to automatically populate the greeting_txt text field on the Stage with the user's current OS language. Instead of using the initialize() method directly, use the string replacement method of "automatically at runtime".

import mx.lang.Locale;
trace(System.capabilities.language);
Locale.autoReplace = true;
Locale.addDelayedInstance(greeting_txt, "IDS_GREETING");
Locale.initialize();