0
votes

I have created a actionscript with Capabilities function It works good, but I want to ad a If else statement on the capabilities for language.

I'm running in English so the capabilities shows " EN ", but I want the if else statement to change " EN " to = English, and if we are running in different language it would say " Other language"

This is what i have at the moment.

var versionString = Capabilities.language;

var label2:TextField = createCustomTextField(0, 60, 200, 20);
label2.text = "language: " + Capabilities.language;

Any ideas how to use the if and else statement ?

1

1 Answers

1
votes

try:

label2.text = "language: " + (Capabilities.language.toLowerCase() == "en" ? "English" : "Other");

or the normal if statement way:

if(Capabilities.language.toLowerCase() == "en"){
    label2.text = "language: English";
} else {
    label2.text = "language: Other";
}