FlashVars and IE/Mac

For the past few months I’ve been trying to insert Flash into web pages using valid XHTML which has been relatively easy, until I started using FlashVars to pass data in.

The standard XHTML is:

  <object type="application/x-shockwave-flash"
      width="xxx" height="yyy">
    <param name="movie" value="movie.swf" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="backgroundColour" />

So then comes the fun – using FlashVars to pass variables in, which as far as I was aware was a case of;

  1. adding a query string to the value parameter of the <param name="movie"...>, and
  2. adding the extra <param name="FlashVars" value="variables" />

Great, works in all browsers – IE/Win, FF/Win, Safari/Mac, FF/Mac… until you try it on IE/Mac and then the variables are not passed in… boooo!

Finally, figured that what is needed is the addition of a query string to the data parameter of the <OBJECT> tag, so in the end, we get;

  <object type="application/x-shockwave-flash"
      width="xxx" height="yyy">
    <param name="movie" value="movie.swf?variables" />
    <param name="FlashVars" value="variables" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="backgroundColour" />

And there we have it, suddenly IE/Mac springs into life and does as it’s told!

I’m sure this is well documented somewhere, but I just hadn’t got round to finding that documentation wherever it might live.

It’s also a real pain having to duplicate these variables three times just so that all combinations of browsers work. By the looks of it, IE/Mac is the only one that uses the query string on the data parameter; then IE/Win uses FlashVars, and FF uses the query string on the <PARAM name="movie"...> tag (not sure which one Safari picks up on!)

Hopefully now that Microsoft aren’t devloping IE/Mac anymore it will go out of use as people upgrade to a supported browser, but unfortunately the site this was being developed for could be accessed by various people that are still using IE/Mac as their main browser so the work had to be put in.


About Theo Gray

MCP, Web Designer/Developer and Musician (when spare time allows)
This entry was posted in Computers and Internet. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s