TwelvestoneFlash

Linking a flash object


Sign in

  • Waiting for Godot ( 730 k posts )
    Just conversation.
  • Thunder Dome ( 23 k posts )
    Photoshop Tennis and Collabs.
  • Photography ( 5.1 k posts )
    For all you shutterbugs, sh...
  • Flash ( 18 k posts )
    ActionScripting to tweens, ...
  • Front End ( 5.9 k posts )
    general front end design an...
  • Back End ( 9.7 k posts )
    serverside scripting, progr...
  • Projects and Theory ( 12 k posts )
    This forum is for discussio...
  • FAQ ( 269 posts )
    All those nagging questions...
  • Design ( 17 k posts )
    graphics & all aspects of g...
  • Purgatory ( 3.6 k posts )
    12stone Jail, feel free to ...
BOBBYLOVEVILLE
 
2009-05-12

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!

DontBogartMe
 
2009-05-12

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

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

in the OBJECT tag:

in the EMBED tag:

Then in flash, you'd use:

on(release){ getURL(_root.buttonurl1, "_blank"); }

JERKSTORE
 
2009-05-12

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);

Sorry, you must be a member to post to a conversation. Either log in or sign up to get involved.
TwelvestoneFlash

Linking a flash object