Several instant languages in a Flash site. How did he do it?

Hi, i’ve recently visited\rand have seen a nice method for using several languages which can be quickly switched anytime, without having to load anything again.\rFrom what I’ve seen, the Flash site is loaded with some .txt files which contain the specific language (tab_ingles.txt, tab_cast.txt, tab_italiano.txt, etc.). However, the structure of them is somehow peculiar:\r\rtab_ingles.txt\r---------------\r&tab1=profile\r&tab2=photos\r&tab3=links\r&tab4=forum\r&tab5=contact\r&hola=Welcome\r&perfil=Hi, my name is\r&cerrar=CLOSE\r&tit1=PROFILE\r&tit2=PHOTOS\r&tit3=LINKS\r&recomendar=javascript<img src= ALT=":o"> penIT4FLASH(‘recomendar_ingles.html’,300,450,null,null,‘n’);\r\rSo here, &tab1 to &tab5 are the English texts to be displayed in the main menu. &perfil is the text regarding the profile of the fellow, and this goes on like this with every text entry in the whole site.\rNow my question is first: how has he connected flash to read a .txt file?\rAnd second, is this technique one of the author or is it a common known technique. If so, does anyone know of a tutorial for this?\r\rThank you very much,\rManare.

Manare-\r I only have the answer to one Q I think. If there are several languages, they were indeed all loaded from the start. i.e. Same site with german, loaded from the start, activated by a button, calls up the same site, different langauge. So your reading german and wanna go to swahili? Already loaded at the beginning, activated by a button, calls up entire site written in swahili. I assume thats how he did it. Make sense or not? \r\rpj\r:p

Hi,\rYes of course, that is exactly what it can be deduced. The thing is, how did the author manage to make it all work that way? (as it’s an excellent idea)\rThanks,\rManare

‘‘how has he connected flash to read a .txt file?’’\r\reach of the buttons brings in the corresponding language txt-file, all textfields in the fla are dynamic and assigned the same variable names as in the txt-file.\rVery simple, yet usefull technique, as the txt-files are easy to update, i used that\rin my (incomplete) links section: , where each button loads in a text file.\r\rlong time no see!

Hi there eyezberg!\r\rThanks for your answer. I get the general idea, nevertheless what I can’t figure out is the piece of AScript that must be attached to the button itself, in order to link the .txt file and read/use it properly. So perhaps, could you please give me an example of that piece of AS, so that I can see exactly how it works?\rI’m glad to be back! :smiley: \rThanks for your time,\r\rManare

Basically, you got 2 options:\r1/load in the complete txt at the start of the swf, so all the info is available all the time: loadVariablesNum (“myvars.txt”, 0)//placed on 1st keyframe of _root, this makes all the vars in the txt available from anywhere in your fla by using _root.varYouNeedHere; another option is using an empty container clip (i tend to use this method, keeps things organised), called s’thing like dataHolder, and attach the loadVariables (no “Num” anymore !) either to onLoad of that clip (in this case, replace the 0 by “this” to load into the same clip), or to change the target to the name of your clip…this is all a bit confusing, i fear?!\r\rloadVariables (url, target) //this is what you use\rurl= the file you want to load\rtarget= either a level (loadVariablesNum) or a target: _root, _root.dataClip, this…\rbefore using the variables loaded in, you should make sure everything is ready, that’s why you put a least ‘flag’ variable at the end of your txt-file (like &status=done) and check the value of status in flash before proceeding: if (status=done){do this}else{don’t do it} :wink: \r\rShould i write a tutorial on this (i thought there is one, Kirupa?)?\rHelps a bit?

Yes, it’d interesting to know if there’s a tutorial for this.\rI guess this technique is easy to implement but it looks a bit fuzzy to me (I guess my neurons have become a kinda rusty after this long period…)\rThank you very much Eyezberg for your answer.\r\rManare

Pfff, I’m about to give up trying to find a tut on this subject. Does it really exist? Was it at kirupa’s? I’ve been looking at Flaskit but haven’t found it either. Any clue??\rI repeat it, I guess this technique’s easy to be done but I just can’t make it work. :frowning: \r\rThanks,\rManare