打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
FLV播放器全屏AS代码(AS2)
FLV播放器全屏AS代码(AS2)

/**
---------------------------------

全屏模式控制
---------------------------------
**/

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;
   videoHeightSet = 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 newMenu:ContextMenu = new ContextMenu();
var newMenu: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;
}
}

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
SWF动画真正实现无缩放全屏显示代码教程
AS3 如何在浏览器中全屏
在flash8中编译器不认displayState属性。
【新周期flash】学做带右键菜单的动画
简单制作属于自己的FD模板
(6)FLASH8完全全屏浏览实现方法
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服