# Dynamic variable name

**URL:** <https://forum.kirupa.com/t/dynamic-variable-name/288497>\
**Category:** Uncategorized\
**Created:** [May 17, 2009, 12:46am UTC](https://forum.kirupa.com/t/dynamic-variable-name/288497 "2009-05-17T00:46:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruiganga](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ruiganga/32/3679_2.png) [@ruiganga](https://forum.kirupa.com/u/ruiganga)\
**Post date:** [May 17, 2009, 12:46am UTC](https://forum.kirupa.com/t/dynamic-variable-name/288497/1 "2009-05-17T00:46:35Z")

</div>

HI

I am trying to make a 2 languages flash website. I need to know if something similar to the following can be done:

var selectedLanguage:String = “PT”; // PT= Português, EN = English, ES = Español

var welcomePT:String = “bem-vindo”;  
var welcomeEN:String = “welcome”;

var welcomeSL:String // this is the welcome Selected Language

// what I want to do is add the selected language String to welcomeSL

welcomeSL = ([“welcome”]+selectedLanguage); // this line I don’t know how to write, is just a fake example

trace(welcomeSL); // here I want as result “bem-vindo” or “welcome”

I hope someone can understand me. Anyway I’ll wait someone to help me find the best way to have a site with 2 languages. I want to do it in such way, as a client, I can swap the language anytime I want.

Thanks in advance
