Docs Home

sb.swf

@File: /surebert/swf.js

@Description: A constructor used to embed macromedia flash swf, youtube videos, etc. Do not set the sb.swf object's id property to the same name as the object itself. e.g. if your swf object = var mySwf do not set it's id property to 'mySwf' as Internet Explorer will throw an error.


@Param: Object params An objectw ith all the properties of the swf should have once embedded
@Returns: Object An sb.swf instance with the properties specifed in the param argument and by sb.swf.prototype
@Example:

var mySwf = new sb.swf({
    src : 'surebert.swf',
    bgColor : '#000000',
    wmode : 'transparent',
    width : 400,
    height : 300,
    version : 8,
    id : 'swify',
    flashvars : {
        name : 'paul',
        age : 30
    },
    alt : '<div>You need at least flashplayer 8 to play the swf</div>'
});

sb.swf.prototype

@File: /surebert/swf.js

@Description: The properties of any sb.swf instance. All sb.swf.prototype examples below assume the following sb.swf example object was created


@Example:
 
var mySwf = new sb.swf({
    src : 'surebert.swf',
    bgColor : '#000000',
    wmode : 'transparent',
    width : 400,
    height : 300,
    version : 8,
    id : 'swify',
    alt : '<div>You need at least flashplayer 8 to play the swf</div>'
});

sb.swf.prototype.embed

@File: /surebert/swf.js

@Description: Converts the sb.swf into the appropriate swf code for the browser being used by the client and inserts that code into the element specified


@Param: element el Either an object reference to a dom element or a string reference that can be passed through sb.$ e.g. use the elements id '#someElement'
@Returns: String The HTML code required to embed the flash swf into the DOM, can be used as the innerHTML of another element
@Example:

    mySwf.embed('#someElement');
    

sb.swf.prototype.toHTML

@File: /surebert/swf.js

@Description: Converts the sb.swf into the appropriate swf code for the browser being used by the client


@Returns: String The HTML code required to embed the flash swf into the DOM, can be used as the innerHTML of another element
@Example:

    var string = mySwf.toHTML();
    //on embed style browsers returns
    <embed type="application/x-shockwave-flash" src="mySwf.swf" id="mySwf" wmode="transparent" allowScriptAccess="always" bgcolor="#000000" width="400" height="300" />
    
    //on explorer returns
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300" id="mySwf"><param name="movie" value="mySwf.swf" /><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /></object>