probably a total noob question, but anyways, Is there any way to link a flash object without doing it within the movie itself?
I am building flash buttons for an intranet portal and want it so that the users dont need to know how to crack open flash if they need to change the linkto for the buttons but could instead do it with simple code change or something outside of the movie itself....
Thanks!
in the HTML that shows the Flash, pass in the URL you want the button to link to as a flashvar (how you do that depends on the way you show the Flash), then in the Flash of your button you grab that flashvar and use that in the getURL call.
That way they only need to edit the HTML to change the links.
damn, now I gotta read up on flashvars...
everything I'm finding in searching for the solution seems too complex for what I want to do. I just want to take the traditional
on (release) { getURL ("MYFILE.php", "_blank"); }
and make if so I can set a getURL function in AS to take the flashvar sent from the object embed params, right?
in the OBJECT tag:
in the EMBED tag:
Then in flash, you'd use:
on(release){ getURL(_root.buttonurl1, "_blank"); }
Or, if you're using something like swfobject to generate the embed with Javascript (which is best-practice), it'd be like this:
var flashvars = { buttonurl1: "MYFILE1.php", buttonurl2: "MYFILE2.php" }; var params = {}; var attributes = {}; swfobject.embedSWF("file.swf", "myFlashFile", "550", "400", "9.0.0", "expressInstall.swf", flashvars, params, attributes);