View Full Version : control URL through an external file

08-04-2005, 08:03 PM
I have a button within a .swf that when clicked, opens a new browser window and goes to a new URL. I would like to be able to control the URL through a seperate external file. My goal is to not have to re-export my .swf if I need to update the URL the button is linking to. Any advice or thoughts would be greatly appreciated. Thanks.

08-05-2005, 04:09 PM
You could load the URL into the Flash movie in the Flashvars property of the embed tag. This way you would just need to update your html or in the case of having some middleware you could update it with a database.

There are lots of examples of how to do this on this site and also I think in the help that is included with MX.

If you have further questions let me know and I can set you up with a quick and dirty example.

08-05-2005, 07:31 PM

Please post your PM question in the forum so that everyone can share in the benefit of the answer.


08-05-2005, 11:39 PM
Thanks for your help. I really appreciate you take the time to help. I am still a little confused though.

I thought you would use a text file. Something like:

var link = "http://www.google.com"

and then do something in the fla like:

button.onRelease = function() {
getURL(link, "_self");

Is this way off? Overall I am a little confused about how you create, load and then use the variable. When I define the variable in the fla, it seems to work well. But when I try the external file, things fall apart.

Thanks again.