I have a requirement please guide me. I have a button in flash which opens an URL. and this URL may change weekly or monthly so I just dont want to go and open .fla and change the URL.
So my question is how can I create a button like this.?
you would use loadVar object. to load the text file...
here is an example:
Code:
newURL = new LoadVars();
newURL.onLoad = function(success) {
if (!success) {
trace("FAILED TO LOAD");
}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
button1.onPress = function() {
getURL(webSite);
}
}
};
newURL.load("someTextFile.txt");
alternately.. you could aready have your button actions assigned:
Code:
on(press){
getURL(webSite);
}
the text file should look like this on the inside:
etc..etc.. you could even just set up a loop to do ALL thel inks & buttons at the same time.. but all buttons would need to be named something like button1 button2 button3..and then the vars in the text file would need to be link1 link2 link3..etc..etc.. so you could run a for loop on them,..
I am using internet explorer. And I am wondering why its happening. I am still double clicking to open the link.
And I just wanted to ask you can you help me on creating like the flash piece like it is there in http://www.pg.com.
To make it easy to understand: here the functionality is something like... there are 4 animations for 4 links which are playing simultaneously. Now, when I am taking my mouse to the other links, here its playing the animation corresponding to that particular link and the same for all four animations and links.
I am using Macromedia Dreamweaver to embed the flash. I dont know if this gives any problem. I am not using FireFox browser, I dont know if it gives the same problem there also.
Sorry to bring back this thread from the dead, but have you found a solution to the double click problem? It has nothing to do with the IE click to enable.
I am using CS3, my code is the same as whispers. I see you are no longer having this problem on pg.com vishal.sonar, did you go a different route or did you find a solutions?
I solved the problem i was having, it was so long ago. I believe I replaced the onPress with onRelease to solve the double clicking but I can't be sure.