Inserting Flash Movies in Your Gadget
The JavaScript feature libraries also offer you the capability to embed a .swf Flash video into your gadget. Doing so allows you to quickly, and with minimal code, include a standards-compliant Flash movie.
To integrate this feature, you need to take the following steps:
Within the
ModulePrefsnode of the gadget spec file, add aRequireelement to enable the JavaScriptflashlibrary.Include:
<Require feature="flash"/>
When you wish to insert a new Flash movie into your gadget, call the
embedFlash()method of thegadgets.flashobject.Method call:
gadgets.flash.embedFlash(...);
The flash library also includes
several methods under gadgets.flash for
working with and displaying Flash movies, listed in Table 4-2.
Table 4-2. Methods included under gadgets.flash
Method | Description |
|---|---|
| Embeds a .swf Flash movie, loaded from a provided URL, into a specified DOM node within the gadget. Parameters include:
|
| Embeds a cached Flash movie into the specified DOM node.
Parameters and return type are the same as |
| Returns the major version of the Flash player or |
<Module> <ModulePrefs> <Require feature="flash" /> </ModulePrefs> <Content view="canvas"> <![CDATA[ <div id="insertFlash">Loading Flash Movie ...</div> <script type="text/javascript"> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access