Groups | Blog | Home
all groups > flash actionscript > october 2005 >

flash actionscript : changing links dynamicly with a text file


ManoloBrown
10/6/2005 7:27:52 PM
:beer;I am trying to change URL links dynamically with a text file with this
code:

var myURL:LoadVars = new LoadVars();
myURL.load("info.txt", "GET");

myURL.onLoad = function(success){
if(success) {
info.htmlText = myURL.me;
}
}

cCircle.onRelease = function():Void{
getURL("myURL");
}

the text file that I am using is called info.txt which looks like this:
me= <a href="http://www.yoursite.com"></a>

can anyone tell me how can I make my code work with this text file or is it
even possible please help!!
kglad
10/6/2005 7:38:05 PM
your textfile needs to have a link between your <a href ... > and your </a> if
anything is going to display in your textfield. also, you're going to have 2
ways to open that url: your button and clicking on the link in your textfield.
is that what you want?

and unless you change your textfield you're going to have to use some string
methods that aren't as clean as using the following in your text file:

me=http://www.yoursite.com

and the following in your flash:

var myURL:LoadVars = new LoadVars();
myURL.load("info.txt", "GET");

myURL.onLoad = function(success){
if(success) {
info.htmlText = "<a href="+myURL.me+">yourLink</a>";
}
}

cCircle.onRelease = function():Void{
getURL(myURL.me);
}


AddThis Social Bookmark Button