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!
BOBBYLOVEVILLE 2009.05.12, 01:02PM — Linking a flash object
DontBogartMe 2009.05.12, 01:26PM —
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.
BOBBYLOVEVILLE 2009.05.12, 05:19PM —
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?
JERKSTORE 2009.05.12, 07:25PM —
in the OBJECT tag:
<PARAM NAME=FlashVars VALUE="buttonurl1=MYFILE1.php&buttonurl2=MYFILE2.php">
in the EMBED tag:
<EMBED href="file.swf" FlashVars="buttonurl1=MYFILE1.php&buttonurl2=MYFILE2.php"></EMBED>
Then in flash, you'd use:
on(release){
getURL(_root.buttonurl1, "_blank");
}
JERKSTORE 2009.05.12, 07:28PM —
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);
first