Skip to content

Instantly share code, notes, and snippets.

@sakunyo
Created June 4, 2012 09:48
Show Gist options
  • Save sakunyo/2867528 to your computer and use it in GitHub Desktop.
Save sakunyo/2867528 to your computer and use it in GitHub Desktop.
SwfoWrapper.js
(function(w){
var SwfoWrapper = function(options){
this.initialize(options);
};
SwfoWrapper.prototype = {
callback_: function(e){
// swfobject Callback
var condition = "SmartPhone";
document.body.className += " swfo_called";
if ( !e.success ) {
// Failed Flash embedding
if ( condition ) {
document.body.className += " swfo_smart";
} else {
document.body.className += " swfo_pc";
}
}
},
initialize: fuction(options){
swfobject.embedSWF(
"FILE_NAME.swf",
"flashContent",
"960", "420",
"10.0.0",
"expressInstall.swf",
this.flashvars_ || null,
this.params_ || null,
this.attributes_ || null,
this.callback_ || null
);
}
};
if (!w.SwfoWrapper) {
w.SwfoWrapper = SwfoWrapper;
}
}(window));
var options = {
swf: "FILE_NAME.swf",
"flashContent",
"960",
"420",
"10.0.0",
null,
flashvars = {},
params = {
//wmode: "transparent"
},
attributes = {}
};
var swfow = new SwfoWrapper(options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment