# Using variables to load different texts languages when translating website

**URL:** https://forum.kirupa.com/t/using-variables-to-load-different-texts-languages-when-translating-website/288319
**Category:** flash
**Created:** [May 14, 2009, 5:50am UTC](https://forum.kirupa.com/t/using-variables-to-load-different-texts-languages-when-translating-website/288319 "2009-05-14T05:50:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![lordrt](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@lordrt](https://forum.kirupa.com/u/lordrt)
#### Post date: [May 14, 2009, 5:50am UTC](https://forum.kirupa.com/t/using-variables-to-load-different-texts-languages-when-translating-website/288319/1 "2009-05-14T05:50:13Z")

</div>

Hi all,  
I want to load a different text in my flash when I change the language setting of my website…site being in drupal and having a translation module init.  
My flash in fact reads the text from a text file.

I tried using this as2 script code in flash 8:

3 vars:

1. i18n\_string:String //i18n is in fact the name of the translation module for drupal
2. i18n\_load\_text:Object
3. var lang = “some language”

i wrote the code as follows:  
i18n\_string=i18n\_load\_text[lang];  
myLoadvar.onLoad = function(success){  
if (success)  
{  
if(i18n\_string=i18n\_load\_text[‘en’]  
myText.text = myLoadvar.variable1; //variable1 is found in text file, and point to english text  
else if(i18n=i18n\_load\_text[‘fr’]  
myText.text = myLoadvar.variable2; //for french text  
}  
}  
myLoadvar.load(“textfile.txt”);

Still when running movie i get something like \_level0.Text1 scrolling in it…anyone can help plz…:crying:

Also is the following correct in my text file: ??  
variable1={english text}  
variable2={french text}  
var…3={}  
…  
…  
…  
…
