| Previous | Tutorial: Developing a Multi-Language Application with ActionScript 2.0 4 of 4 |
For the first time in our application we make use of the language resources. We use the "LanguageManager.LANG" array not only for populating the ComboBox component but also for setting the label text above the ComboBox.
// function doSomething()
public function doSomething(): Void {
_main_mc.monthNames_lbl.text = LanguageManager.LANG["monthNames"];
_main_mc.monthNames_cb.dataProvider = [{data:1, label:LanguageManager.LANG["january"]},
{data:2, label:LanguageManager.LANG["february"]},
{data:3, label:LanguageManager.LANG["march"]},
{data:4, label:LanguageManager.LANG["april"]},
{data:5, label:LanguageManager.LANG["may"]},
{data:6, label:LanguageManager.LANG["june"]},
{data:7, label:LanguageManager.LANG["july"]},
{data:8, label:LanguageManager.LANG["august"]},
{data:9, label:LanguageManager.LANG["september"]},
{data:10, label:LanguageManager.LANG["october"]},
{data:11, label:LanguageManager.LANG["november"]},
{data:12, label:LanguageManager.LANG["december"]}];
}
I used a very simple example in this tutorial. But if you followed the tutorial up to this point you should be able to utilize the same approach for more complex applications. By providing proper methods for initializing the user interface of your application you can let your users easily switch between languages at runtime.
I hope the tutorial was informative and helpful. Please feel free to email me at info@log2e.com if you have any questions.
| Previous | 4 of 4 |