//fscommand("fullscreen", true); if (_root.logoCoolRabbit._visible == false) {
if (Stage["displayState"] == "normal") {
fscommand("fullscreen", true);
Stage["displayState"] = "fullScreen";
}
else if (Stage["displayState"] == "fullScreen") {
fscommand("fullscreen", false);
Stage["displayState"] = "normal";
}
rootWidth = Stage.width;
rootHeight = Stage.height;
//復位控制欄
clearInterval(controlBuffCoolTime);
controlBuffCoolTime = null;
clearInterval(controlBuff);
controlBuffCool = 0;
controlBuffEstimate = null;
//復位標題欄
clearInterval(playTitleBuffCoolTime);
playTitleBuffCoolTime = null;
clearInterval(playTitleBuff);
playTitleBuffCool = 0;
playTitleBuffEstimate = null;
//重新設置組件位置
moduleSet();
//重新計算和設置播放組件尺寸比
videoWidthSet = rootWidth;
videoHeightvideoHeightSet = videoHeight/videoWidth*rootWidth;
playAllModule.playFlvWindow._width = videoWidthSet;
playAllModule.playFlvWindow._height = videoHeightSet;
playAllModule.playFlvWindow._y = (rootHeight-playAllModule.playFlvWindow._height)/2;
}
//全屏模式切換
playAllModule.controlSet.buttonFullScreen.onPress = function() {
setFullScreen();
};
//創建右鍵全屏及退出全屏菜單
//var newnewMenu:ContextMenu = new ContextMenu();
var newnewMenu:ContextMenu = new ContextMenu(menuHandler);
//隱藏右鍵的壹些標準菜單
newMenu.hideBuiltInItems();
// 在右鍵菜單中加入菜單項
//var fs:ContextMenuItem = new ContextMenuItem("全屏", goFullScreen);
var fs:ContextMenuItem = new ContextMenuItem("全屏", setFullScreen);
newMenu.customItems.push(fs);
//var xfs:ContextMenuItem = new ContextMenuItem("退出全屏", exitFullScreen);
var xfs:ContextMenuItem = new ContextMenuItem("退出全屏", setFullScreen);
newMenu.customItems.push(xfs);
// 現在將右鍵菜單指定給場景中的movieclip.我當前指定給場景中的box.妳也可以指定給_root
this.menu = newMenu;
function goFullScreen() {
//Stage["displayState"] = "fullScreen";
}
function exitFullScreen() {
//Stage["displayState"] = "normal";
}
// 定義開啟和關閉全屏功能,取決於妳當前處於哪壹種狀態下
function menuHandler(obj, menuObj) {
if (Stage["displayState"] == "normal") {
// 如果妳當前處在正常模式下,則goFullscreen可點擊
menuObj.customItems[0].enabled = true;
menuObj.customItems[1].enabled = false;
} else {
// 如果妳當前片在全屏模式下,則exitFullScreen可點擊
menuObj.customItems[0].enabled = false;
menuObj.customItems[1].enaenabled = true;
}
}