dojox.flash.Embed.prototype.write
dojo.require("dojox.flash._base");
defined in dojox/flash/_base.js
This must be called before the page is finished loading.
Usage
function (/*Boolean?*/ doExpressInstall) (view source)
var containerStyle = ""; containerStyle += ("width: " + this.width + "px; "); containerStyle += ("height: " + this.height + "px; "); if(!this._visible){ containerStyle += "position: absolute; z-index: 10000; top: -1000px; left: -1000px; "; } // figure out the SWF file to get and how to write out the correct HTML // for this Flash version var objectHTML; var swfloc = dojox.flash.url; var swflocObject = swfloc; var swflocEmbed = swfloc; var dojoUrl = dojo.baseUrl; if(doExpressInstall){ // the location to redirect to after installing var redirectURL = escape(window.location); document.title = document.title.slice(0, 47) + " - Flash Player Installation"; var docTitle = escape(document.title); swflocObject += "?MMredirectURL=" + redirectURL + "&MMplayerType=ActiveX" + "&MMdoctitle=" + docTitle + "&baseUrl=" + escape(dojoUrl); swflocEmbed += "?MMredirectURL=" + redirectURL + "&MMplayerType=PlugIn" + "&baseUrl=" + escape(dojoUrl); }else{ // IE/Flash has an evil bug that shows up some time: if we load the // Flash and it isn't in the cache, ExternalInterface works fine -- // however, the second time when its loaded from the cache a timing // bug can keep ExternalInterface from working. The trick below // simply invalidates the Flash object in the cache all the time to // keep it loading fresh. -- Brad Neuberg swflocObject += "?cachebust=" + new Date().getTime(); } if(swflocEmbed.indexOf("?") == -1){ swflocEmbed += '?baseUrl='+escape(dojoUrl); }else{ swflocEmbed += '&baseUrl='+escape(dojoUrl); } objectHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ' + 'codebase="' + this.protocol() + '://fpdownload.macromedia.com/pub/shockwave/cabs/flash/' + 'swflash.cab#version=8,0,0,0"\n ' + 'width="' + this.width + '"\n ' + 'height="' + this.height + '"\n ' + 'id="' + this.id + '"\n ' + 'name="' + this.id + '"\n ' + 'align="middle">\n ' + '<param name="allowScriptAccess" value="sameDomain"></param>\n ' + '<param name="movie" value="' + swflocObject + '"></param>\n ' + '<param name="quality" value="high"></param>\n ' + '<param name="bgcolor" value="#ffffff"></param>\n ' + '<embed src="' + swflocEmbed + '" ' + 'quality="high" ' + 'bgcolor="#ffffff" ' + 'width="' + this.width + '" ' + 'height="' + this.height + '" ' + 'id="' + this.id + 'Embed' + '" ' + 'name="' + this.id + '" ' + 'swLiveConnect="true" ' + 'align="middle" ' + 'allowScriptAccess="sameDomain" ' + 'type="application/x-shockwave-flash" ' + 'pluginspage="' + this.protocol() +'://www.macromedia.com/go/getflashplayer" ' + '></embed>\n' + '</object>\n'; // using same mechanism on all browsers now to write out // Flash object into page // document.write no longer works correctly // due to Eolas patent workaround in IE; // nothing happens (i.e. object doesn't // go into page if we use it) dojo.connect(dojo, "loaded", dojo.hitch(this, function(){ var div = document.createElement("div"); div.setAttribute("id", this.id + "Container"); div.setAttribute("style", containerStyle); div.innerHTML = objectHTML; var body = document.getElementsByTagName("body"); if(!body || !body.length){ throw new Error("No body tag for this page"); } body = body[0]; body.appendChild(div); }));
parameter | type | description |
---|---|---|
doExpressInstall | Boolean | Optional. Whether to write out Express Install information. Optional value; defaults to false. determine our container div's styling |