Create a wrapper object around a Flash movie; this is the DojoX equivilent to SWFObject.
Creates a wrapper object around a Flash movie. Wrapper object will insert the movie reference in node; when the browser first starts grabbing the movie, onReady will be fired; when the movie has finished loading, it will fire onLoad.
If your movie uses ExternalInterface, you should use the onLoad event to do any kind of proxy setup (see dojox.embed.Flash.proxy); this seems to be the only consistent time calling EI methods are stable (since the Flash movie will shoot several methods into the window object before EI callbacks can be used properly).
Parameter | Type | Description |
---|---|---|
kwArgs | Object | The various arguments that will be used to help define the Flash movie. |
node | DomNode | The node where the embed object will be placed |
See the dojox/embed/Flash reference documentation for more information.
Embed a flash movie in a document using the new operator, and get a reference to it.
var movie = new dojox.embed.Flash({ path: "path/to/my/movie.swf", width: 400, height: 300 }, myWrapperNode, "testLoaded");
Embed a flash movie in a document without using the new operator.
var movie = dojox.embed.Flash({ path: "path/to/my/movie.swf", width: 400, height: 300, style: "position:absolute;top:0;left:0" }, myWrapperNode, "testLoaded");
Used as both a detection (i.e. if(dojox.embed.Flash.available){ }) and as a variable holding the major version of the player installed.
The minimum supported version of the Flash Player, defaults to 8.
Whether or not the Flash Player installed is supported by dojox.embed.
The version of the installed Flash Player; takes the form of { major, minor, rev }. To get the major version, you'd do this: var v=dojox.embed.Flash.version.major;
Gets Flash movie by id.
Probably includes methods for outdated browsers, but this should catch all cases.
Parameter | Type | Description |
---|---|---|
movieName | String | The name of the SWF |
doc | Object | The document, if not current window (not fully supported) |
var movie = dojox.embed.Flash.byId("myId");
Public interface for destroying all the properties in this object. Will also clean all proxied methods.
Initialize (i.e. place and load) the movie based on kwArgs.
Parameter | Type | Description |
---|---|---|
kwArgs | Object | An object with the following properties:
|
node | DOMNode |
Optional
|
Parameter | Type | Description |
---|---|---|
kwArgs | undefined | |
node | undefined |
Create the set of passed methods on the Flash object so that you can call that object directly, as opposed to having to delve into the internal movie to do this. Intended to make working with Flash movies that use ExternalInterface much easier to use.
Parameter | Type | Description |
---|---|---|
obj | dojox/embed/Flash | |
methods | Array | String |
Create "setMessage" and "getMessage" methods on foo.
var foo = new Flash(args, someNode); dojo.connect(foo, "onLoad", lang.hitch(foo, function(){ Flash.proxy(this, [ "setMessage", "getMessage" ]); this.setMessage("Flash.proxy is pretty cool..."); console.log(this.getMessage()); }));
Parameter | Type | Description |
---|---|---|
msg | undefined |
Create "setMessage" and "getMessage" methods on foo.
var foo = new Flash(args, someNode); dojo.connect(foo, "onLoad", lang.hitch(foo, function(){ Flash.proxy(this, [ "setMessage", "getMessage" ]); this.setMessage("Flash.proxy is pretty cool..."); console.log(this.getMessage()); }));
A stub you can connect to if you are looking to fire code when the engine becomes available. A note: DO NOT use this event to place a movie in a document; it will usually fire before DOMContentLoaded is fired, and you will get an error. Use dojo.addOnLoad instead.
Create "setMessage" and "getMessage" methods on foo.
var foo = new Flash(args, someNode); dojo.connect(foo, "onLoad", lang.hitch(foo, function(){ Flash.proxy(this, [ "setMessage", "getMessage" ]); this.setMessage("Flash.proxy is pretty cool..."); console.log(this.getMessage()); }));
Stub function for you to attach to when the movie has finished downloading and is ready to be manipulated.
Parameter | Type | Description |
---|---|---|
movie | HTMLObject |
Create "setMessage" and "getMessage" methods on foo.
var foo = new Flash(args, someNode); dojo.connect(foo, "onLoad", lang.hitch(foo, function(){ Flash.proxy(this, [ "setMessage", "getMessage" ]); this.setMessage("Flash.proxy is pretty cool..."); console.log(this.getMessage()); }));
Stub function for you to attach to when the movie reference is first pushed into the document.
Parameter | Type | Description |
---|---|---|
movie | HTMLObject |
Create "setMessage" and "getMessage" methods on foo.
var foo = new Flash(args, someNode); dojo.connect(foo, "onLoad", lang.hitch(foo, function(){ Flash.proxy(this, [ "setMessage", "getMessage" ]); this.setMessage("Flash.proxy is pretty cool..."); console.log(this.getMessage()); }));