Image

Imagewelling1 wrote in Imageflashdev

issue with double click with LoadVars with outside url?

This seems like it should be fairly simple!

I'm trying to use an outside .txt file which contains a url link that the .swf reads to direct the browser to another web page. The following code works fine, but i have to double click on the .swf to get the link to work.-- (it happens in both safari and firefox).

If anyone has any insight as to the double clicking issue or knows of a better way to do this, please share!

Thanks for any insight!

code in txt file:
link=http://www.thelinkgoeshere.com



on .fla button:

on (release) {
newURL = new LoadVars();
newURL.onLoad = function(success) {
if (!success) {
trace("fail");
} else {
//do whatever you want to happen IF successful
trace(newURL.link);
//newURL = your textFile & link = variable in text file
webSite = newURL.link;
//set button code
button.onPress = function() {
getURL(webSite);
};
}
};
newURL.load("url.txt");
}