dojox.flash

The goal of dojox.flash is to make it easy to extend Flash's capabilities into an Ajax/DHTML environment. dojox.flash provides an easy object for interacting with the Flash plugin. This object provides methods to determine the current version of the Flash plugin (dojox.flash.info); write out the necessary markup to dynamically insert a Flash object into the page (dojox.flash.Embed; and do dynamic installation and upgrading of the current Flash plugin in use (dojox.flash.Install). If you want to call methods on the Flash object embedded into the page it is your responsibility to use Flash's ExternalInterface API and get a reference to the Flash object yourself. To use dojox.flash, you must first wait until Flash is finished loading and initializing before you attempt communication or interaction. To know when Flash is finished use dojo.connect: dojo.connect(dojox.flash, "loaded", myInstance, "myCallback"); Then, while the page is still loading provide the file name: dojox.flash.setSwf(dojo.moduleUrl("dojox", "_storage/storage.swf")); If no SWF files are specified, then Flash is not initialized. Your Flash must use Flash's ExternalInterface to expose Flash methods and to call JavaScript. setSwf can take an optional 'visible' attribute to control whether the Flash object is visible or not on the page; the default is visible: dojox.flash.setSwf(dojo.moduleUrl("dojox", "_storage/storage.swf"), false); Once finished, you can query Flash version information: dojox.flash.info.version Or can communicate with Flash methods that were exposed: var f = dojox.flash.get(); var results = f.sayHello("Some Message"); Your Flash files should use DojoExternalInterface.as to register methods; this file wraps Flash's normal ExternalInterface but correct various serialization bugs that ExternalInterface has. Note that dojox.flash is not meant to be a generic Flash embedding mechanism; it is as generic as necessary to make Dojo Storage's Flash Storage Provider as clean and modular as possible. If you want a generic Flash embed mechanism see SWFObject (http://blog.deconcept.com/swfobject/). Notes: Note that dojox.flash can currently only work with one Flash object on the page; it does not yet support multiple Flash objects on the same page. Your code can detect whether the Flash player is installing or having its version revved in two ways. First, if dojox.flash detects that Flash installation needs to occur, it sets dojox.flash.info.installing to true. Second, you can detect if installation is necessary with the following callback: dojo.connect(dojox.flash, "installing", myInstance, "myCallback"); You can use this callback to delay further actions that might need Flash; when installation is finished the full page will be refreshed and the user will be placed back on your page with Flash installed. ------------------- Todo/Known Issues ------------------- * On Internet Explorer, after doing a basic install, the page is not refreshed or does not detect that Flash is now available. The way to fix this is to create a custom small Flash file that is pointed to during installation; when it is finished loading, it does a callback that says that Flash installation is complete on IE, and we can proceed to initialize the dojox.flash subsystem. * Things aren't super tested for sending complex objects to Flash methods, since Dojo Storage only needs strings Author- Brad Neuberg, http://codinginparadise.org

Jump to PropertiesJump to FunctionsConstructorsBack to top

A class that is used to communicate between Flash and JavaScript.
ConstructorEmbed(visible)
A class that is used to write out the Flash object into the page.
ConstructorInfo()
A class that helps us determine whether Flash is available.
Helps install Flash plugin if needed.
ConstructorsetSwf(url: String, visible: Boolean?)
Sets the SWF files and versions we are using.

Jump to PropertiesJump to ConstructorsFunctionsBack to top

Adds a listener to know if Flash is being installed. Useful if you don't want a dependency on dojo.event.
Adds a listener to know when Flash is finished loading. Useful if you don't want a dependency on dojo.event.
Called if Flash is being installed.
Called back when the Flash subsystem is finished loading.

Jump to FunctionsJump to ConstructorsPropertiesBack to top