This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Flash Site Design > February 2004 > dynamic text from a text file





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author dynamic text from a text file
orlya webforumsuser@macromedia.com

2004-02-02, 6:28 am

Hello,
I'm using flash MX
Is it possible in flash, to create a text field which will be populated from an outer text file?
so I want have to edit the fla file everytime I want to change the text
Thanx
orlya


domconlon webforumsuser@macromedia.com

2004-02-02, 7:28 am

yes it is. you can do this as one way:

loadVarsText = new loadVars();
loadVarsText.load("mytextfile.txt");
loadVarsText.onLoad = function(success) {
if (success) {
customer = this.var1;
title = this.var2;
mydate = this.var3;
copy = this.var4;
}
}


in the text file set it out as follows:

var1=Some text here and remember to keep the ampersand after this word&var2=more text&var3=www.head-first.co.uk&var4=This has been a pleasure. But there are other ways to do this such as using XML.

Hope this helps.

Dom


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews