I have a SWF with text embedded from an external .txt file. Is there a way I can have a different file used as the text source through the embedcode (swfObject) depending on the language?

Here is my current actionscript:

myData = new LoadVars();
myData.onLoad = function() {
info_clip.info_details.text_clips.project_title.text = this.projecttitle1;

var loader:MovieClipLoader = new MovieClipLoader();

This is the content of translatetext.txt:

projecttitle1=This is my translatable text

This is the embed code I'm using:

<object width="960" height="275" id="rvFlashcontent">
<param name="movie" value="rvflashtour8.2.swf" />
<param name="wmode" value="transparent" />
<param name="flashvars" value="projectimage1=flashimages/brit_cafe_rc2.jpg" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="rvflashtour8.2.swf" width="960" height="275">
<param name="wmode" value="transparent" />
<param name="flashvars" value="projectimage1=flashimages/brit_cafe_rc2.jpg" />
<img src="/images/french_cafe.jpg" alt="French Cafe">
<!--[if !IE]>-->

What I want to do is add a Flashvars parameter to name the file to load, so I can change the language:

<param name="flashvars" value="projectimage1=flashimages/brit_cafe_rc2.jpg&projecttext=textfrench.txt" />

Thanks in advance all!

1 answer


Where do you get the language var from? because then id say just give the language variable to your actionscript (which im not familiar with btw) and then switch the language variable. (only good if you know which languages are available, but i presume you do if you have multilingual text files. pseudo code: from HTML:

    load: swf + language_var;


var file = '';
   case 'fr': file ='textfrench.txt';break;
   case 'en': file='textenglish.txt'break;
  default: break;


I have some swf embedded in my current project and this is kindof the way i pass variables to it ( not that i know for sure, someone else made the swf ;P )

Hope you can progress. Cheers

Answered almost 7 years ago by Menno Geelen
  • That's not a bad idea, but it would mean the developers would need to get a new SWF each time they add a language, which I'd prefer to avoid since I don't work with them full time, and don't know exactly which languages are going to be added in the future. Cormac almost 7 years ago