- function setfullscreen() {
- //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].enabled = true;
- }
- }
|