Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating simple dynamic text with XML 1

Status
Not open for further replies.

monoone

Programmer
May 24, 2002
219
US
Hello;

I have a search field that is part of my flash movie.

I have two words that will be dynamic (coldfusion). Search and GO for diffrent languages. What I would like to do is create an xml file that will be source of those two words so they can be changed dynamically from the XML page.

Any ideas?

Eric
 
You can do this a variety of ways, here's a couple of suggestions:

1) Have the different language versions each in their own XML file then load the correct language in like this...

wordsXML=new XML();
wordsXML.load('wordsFile_'+lang+'.xml');

... where 'lang' is a variable determining the language of the user. This variable can be set in a query string in the movie's URL or could be chosen within the movie itself via a dropdown or radio button array.

2) Have one XML file with all of the versions in it and an attribute on every node acting as a key to tell Flash which language is contained in that node:

<translation lang=&quot;english&quot;>whatever...</translation>

or all as attributes (much faster in the Flash parser)...

<translation lang=&quot;english&quot; go=&quot;GO&quot; search=&quot;SEARCH&quot; />
<translation lang=&quot;deutsch&quot; go=&quot;GEHEN&quot; search=&quot;SUCHE&quot; />

...then read everything into an associative array in Flash using 'lang' as the index.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top