import flash.system.Capabilities;
trace(Capabilities.os);
Returns 'Mac OS 10.5.0'. Hallelujah.
My flipping sweet blog.
import flash.system.Capabilities;
trace(Capabilities.os);
if(configXML..mode == "desktop")
{
//start us up in desktop mode
var config_api_key:String = configXML..api_key;
var config_secret:String = configXML..secret;
fBook.startDesktopSession(config_api_key, config_secret);
}
else
{
//start us up in widget mode
fBook.startWidgetSession();
}
fBook.useRedirectServer = true;
fBook.rest_url = configXML..redirect_server_url;
function positionBackground(){
//set this to the width of your background image
var backgroundImageWidth = 760;
var size = getPageSize();
var body = document.body;
if( navigator.userAgent.indexOf('Safari') != -1 || navigator.appVersion.indexOf("MSIE") != -1)
{
if(size.width % 2 == 1){
size.width -= 1;
}
}
body.style.backgroundPosition = size.width/2 - (backgroundImageWidth / 2);
}
function getPageSize() {
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
return {width:myWidth,height:myHeight};
}
window.onresize = positionBackground;
window.onload = positionBackground;