/* TEST BY Jesse Graupmann | justgooddesign.com | jessegraupmann.com SOURCE Article from http://www.adobe.com/devnet/flashplayer/articles/full_screen_mode.html http://labs.adobe.com/wiki/index.php/Flash_Player:9:Update:Full-Screen_Mode:Demos http://www.robgonda.com/blog/index.cfm/2006/10/5/scary-or-neat-Flash-Full-Screen-Mode NOTES - HTML requires allowFullscreen = true in both object and embed tags - user can only call fullscreen from mouse click - when in fullscreen mode ( not local ), key input is blocked */ // // // EVENT EXAMPLE // // function updateTextFields ( bFull:Boolean ) { if ( bFull )_txt = "Exit Full Screen Mode"; else _txt = "Enter Full Screen Mode"; } this.onFullScreen = function( bFull:Boolean ){updateTextFields(bFull)} Stage.addListener( this ); // // // BUTTON EXAMPLE // // function toggleStageState () { Stage["displayState"] = Stage["displayState"] == "normal" ? "fullScreen" : "normal"; } btn.onPress = toggleStageState; // // // CONTEXT MENU EXAMPLE // // // functions to enter and leave full screen mode function goFullScreen() { Stage["displayState"] = "fullScreen"; } function exitFullScreen() { Stage["displayState"] = "normal"; } // function to enable, disable context menu items, based on which mode we are in. function menuHandler(obj, menuObj) { if (Stage["displayState"] == "normal") { // if we're in normal mode, enable the 'go full screen' item, disable the 'exit' item menuObj.customItems[0].enabled = true; menuObj.customItems[1].enabled = false; } else { // if we're in full screen mode, disable the 'go full screen' item, enable the 'exit' item menuObj.customItems[0].enabled = false; menuObj.customItems[1].enabled = true; } } // create a new context menu var fullscreenCM:ContextMenu = new ContextMenu(menuHandler); // hide the regular built-in items fullscreenCM.hideBuiltInItems(); // now, add the items to enter and leave full screen mode var fs:ContextMenuItem = new ContextMenuItem("Go Full Screen", goFullScreen); fullscreenCM.customItems.push( fs ); var xfs:ContextMenuItem = new ContextMenuItem("Exit Full Screen", exitFullScreen); fullscreenCM.customItems.push( xfs ); // now, attach the context menu to any movieclip in your movie. // here we attach it to _root, (even though using _root is generally a bad idea,) // so it will appear if you right click anywhere on the movie. _root.menu = fullscreenCM; // // EXTRA // Stage.align = 'TL' Stage.scaleMode = 'noScale'; Stage.addListener( bg ); bg.onResize = function(){ bg._width = Stage.width; bg._height = Stage.height; } bg.onResize(); function flashVersion():Number{ return Number( String(_root['$version'].split(',')[0].substr(-1,1) )); } var ver = flashVersion(); if ( ver < 9 ) subtitle.text = "FOR FLASH PLAYER 9 AND ABOVE\nTO SEE THIS YOU'LL NEED TO UPGRADE FROM VERSION " + ver