Google Swiffy: How to pass variables from javascript to HTML5 swiffyobject?

212 Views Asked by At

I've read through what little documentation there is on Google's Swiffy page, and I don't see any way to pass FlashVars data to the HTML5 swiffyobject.

On an old version of a site there is this embed code (which uses SWFobject) to pass a javascript variable to Flash:

var mainmovie = new SWFObject("mainpage.swf", "themovie", "640", "480", "8", "#000099");
                        mainmovie.addParam("align", "middle");
                        mainmovie.addParam("wmode", "opaque");
                        mainmovie.addVariable("PageLayout", layoutCode);
                        mainmovie.write("target_div");

In other words, the variable PageLayout is passed to the Flash movie from .js

Is there some way to similarly pass javascript variables to swiffyobjects, either through something similar to SWFobject's addVariable, or through the standard FlashVars interface?

1

There are 1 best solutions below

0
Bangkokian On

Just answering my own question here because I found the answer.

The Swiffy equivalent of FlashVars is:

stage.setFlashVars("VariableName = value");

where "stage" is the Swiffy HTML5 object.