W3cubDocs

/Haxe JavaScript

SWFObject

package js.swfobject

@:native("swfobject") Available on js

For detecting the Adobe Flash Player plugin and embedding Flash (swf) files.

Static variables

static ua:{wk:EitherType<Float, Bool>, w3:Bool, pv:Array<Int>, mac:Bool, ie:Bool}

static version:String

swfobject version

Static methods

static addDomLoadEvent (fn:Void ‑> Void):Void

A cross-browser method to execute a function as soon as the DOM of a web page is available. This method is supported by Gecko based browsers - like Firefox -, IE, Opera9+, and, Safari. For all other browsers the method will fall back to the addLoadEvent method.

static addLoadEvent (fn:Void ‑> Void):Void

A safe (it doesn't overwrite existing onload events) cross-browser method to execute a function on the window onload event (which will fire as soon as a web page including all of its assets are loaded).

static createCSS (selStr:String, declStr:String, ?mediaStr:String, ?newStyleBoolean:Bool):Void

Exposes SWFObject's internal cross-browser method to create a dynamic stylesheet. It's most important feature is that it can be called before the DOM of a page is loaded.

static createSWF (attObj:Dynamic, parObj:Dynamic, replaceElemIdStr:String):Element

Exposes SWFObject's internal cross-browser method to create a SWF.

static embedSWF (swfUrlStr:String, replaceElemIdStr:String, widthStr:String, heightStr:String, swfVersionStr:String, xiSwfUrlStr:String, flashvarsObj:Dynamic, parObj:Dynamic, attObj:Dynamic, callbackFn:SWFObjectEvent ‑> Void):Void

Insert alternative content using standards compliant markup and embed Flash content with unobtrusive JavaScript (also called dynamic publishing).

static enableUriEncoding (bool:Bool):Void

static getFlashPlayerVersion ():{release:Int, minor:Int, major:Int}

Returns a JavaScript object containing the major version (major:Number), minor version (minor:Number) and release version (release:Number) of an installed Flash player. Please note that while Flash version numbers normally consist of major.minor.release.build, SWFObject only looks at the first 3 numbers, so both "WIN 9,0,18,0" (IE) or "Shockwave Flash 9 r18" (all other browsers) will translate to "9.0.18".

static getObjectById (objectIdStr:String):Element

NOTE: For static publishing only (or: when using swfobject.registerObject() only)

Returns the active object element. One of the side-effects of the nested-objects approach is that per SWF there are two object elements available in the HTML code, however you can only use one id or name attribute, because these have to be unique within a web page.

static getQueryParamValue (param:String):String

Utility function that returns the value of the paramStr parameter in the URL query string or hash string. Similar functionality was already available in SWFObject 1.5 and lower.

static hasFlashPlayerVersion (versionStr:String):Bool

Returns a Boolean to indicate whether or not a specific minimum version of the Flash plugin is installed. Please note that while Flash version numbers normally consist of major.minor.release.build, SWFObject only looks at the first 3 numbers, so both "WIN 9,0,18,0" (IE) or "Shockwave Flash 9 r18" (all other browsers) will translate to "9.0.18".

static registerObject (objectIdStr:String, swfVersionStr:String, xiSwfUrlStr:String, callbackFn:SWFObjectEvent ‑> Void):Void

Embed Flash content and alternative content using standards compliant markup (the nested-objects method with proprietary Internet Explorer conditional comments), and use JavaScript to resolve the issues that markup alone cannot solve (also called static publishing).

static removeSWF (objElemIdStr:String):Void

Removes a SWF from your web page. Is especially built to safely (only remove a SWF after it has been loaded, to avoid broken references) and completely (nullify references to avoid memory leaks) remove a SWF in Internet Explorer.

static showExpressInstall (att:Dynamic, par:Dynamic, replaceElemIdStr:String, callbackFn:SWFObjectEvent ‑> Void):Bool

Enables developers to reuse SWFObject's internal methods to create their custom Express Install and activate it via the API

static switchOffAutoHideShow ():Void

Disable SWFObject's default show/hide behavior

© 2005–2018 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/swfobject/SWFObject.html