Category Archives: FlashVars

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)

Using HTTPService tag to send/receive variables to a server-side script

The following example demonstrates a very simple usage of sending parameters from Flex to a server-side script (written in ColdFusion) and then displaying the server response in our Flex application. The server-side script is a simple echo/”Hello world” type script, but it accepts URL or FORM variables, so you can send using the GET or POST HTTP-method.

It’s a pretty basic/crude example, but maybe it helps somebody out there.

Full code after the jump.

Continue reading Using HTTPService tag to send/receive variables to a server-side script

Dynamically creating ActionScript cue points from FlashVars loaded using the HTTPService tag

In a previous post, “Dynamically creating ActionScript cue points from FlashVars received from the HTML container”, we looked at how to create ActionScript cue points based on variables passed in to our Flex application from the HTML template’s “FlashVars” parameter. In this post we look at a similar approach, although using the <mx:HTTPService /> tag to load cue points from an external file of name/value pairs. This example could easily be extended further to pass a variable to a server-side script which would grab cue point information from a database and pass it back into Flex either as a string of name/value pairs, or as an XML document.

Full code after the jump.

Continue reading Dynamically creating ActionScript cue points from FlashVars loaded using the HTTPService tag

Dynamically creating ActionScript cue points from FlashVars received from the HTML container

In a previous post, “Creating ActionScript cue points with the VideoDisplay controlEdit”, reader Florian asks how you can set cue points dynamically from FlashVars.

Well, here’s one method of passing a single name/value pair from the HTML template into our Flex application and having Flex parse the string and dynamically add the ActionScript cue points to the VideoDisplay control.

Hope that helps.

Full code after the jump.

Continue reading Dynamically creating ActionScript cue points from FlashVars received from the HTML container

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