In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

Fullscreen Mode From ContextMenuItem

This method fails on Mac Safari
Get Adobe Flash player
by 9re 16 Sep 2010
    Embed
/**
 * Copyright 9re ( http://wonderfl.net/user/9re )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/e3AO
 */

package  
{
    import flash.display.Sprite;
    import flash.display.StageDisplayState;
    import flash.events.ContextMenuEvent;
    import flash.events.MouseEvent;
    import flash.ui.ContextMenu;
    import flash.ui.ContextMenuItem;
    /**
     * ...
     * @author kobayashi-taro
     */
    public class MouseClickTest extends Sprite
    {
        
        public function MouseClickTest() 
        {
            var fullscreen:ContextMenuItem = new ContextMenuItem("Full Screen Mode", true);
            fullscreen.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, function ():void {
                stage.displayState = StageDisplayState.FULL_SCREEN;
            });
            contextMenu = new ContextMenu;
            contextMenu.customItems = [fullscreen];
        }
        
    }

}