Category Archives: HTML template

Grabbing FlashVars from the embedding HTML template in Flex 4 (SWFObject Edition)

In a previous entry, “Grabbing FlashVars from the embedding HTML template”, we saw how you could access FlashVars in your Flex application by passing a name/value pair string to the AC_FL_RunContent() method and <object>/<embed> tags from your HTML template.

The following example shows how you can pass FlashVars from your HTML template to your Flex applications using the Flex 4 SDK (which uses SWFObject now, by the way).

Full code after the jump.

Continue reading Grabbing FlashVars from the embedding HTML template in Flex 4 (SWFObject Edition)

Grabbing FlashVars from the embedding HTML template

What if you built a nice, custom FLV player in Flex and wanted to embed the player in an HTML page and have it star playing a specific video? How could you easily do that without tweaking the MXML each time with the path to the FLV or calling a server-side script to somehow determine the video you wanted to play? Well, one of the easiest solutions is to tweak the generated embed code and pass in any custom variables you wanted using “FlashVars”.

No idea what I’m talking about? Well, check out the following Flex 2.0.1 docs for more of a background: “Using flashVars” and “Using the Application.application.parameters object”.

Full code after the jump.

Continue reading Grabbing FlashVars from the embedding HTML template