Fullscreen Mode From ContextMenuItem
This method fails on Mac Safari
/**
* 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];
}
}
}