Basics of Flash embedding
Minimal Flash embedding setup
Here you have a simple Flash object. Below the object you can see how it is placed on the page:
First you need to include the Flashembed script on your page:
It is recommended that you use the minified (.min) version to reduce the download size. You can get the script here. Second, you have to have a HTML container for the object; we are using a DIV element in our example. We use an id attribute to reference this container later in the embedding.
Next, we place a Flash object inside the container. This happens with this simple flashembed call:
The call must be placed after the DIV element or you must place it inside the $(document).ready() block with jQuery. That is really all you need.
By default, the Flash object is placed inside the player container so that its width and height properties are set to 100%. This means that you can control the dimensions of the Flash object by setting the dimensions of the container. In this minimal setup we have following CSS settings:
Configuring Flash objects
Here we have another Flash object and this time we pass parameters (or configuration) to it. Here is our flashembed call:
Here is the result. The passed parameters are seen:
Configuring Flash with JSON
Flowplayer is one example of a Flash application that accepts JSON-based configurations. Here is our flashembed call:
And here is the result:
If you are developing a Flash object and want to configure it with JSON, you can find JSON parsers for Flash from as3corelib.