• (as3)右键菜单全屏与退出全屏的切换


    //舞台设置
    stage.frameRate=24;
    //右键设置
    var myContextMenu:ContextMenu = new ContextMenu();
    removeDefaultItems();
    addCustomMenuItems();
    this.contextMenu = myContextMenu;
    function removeDefaultItems():void {
     myContextMenu.hideBuiltInItems();
     var defaultItems:ContextMenuBuiltInItems = myContextMenu.builtInItems;
    }
    function addCustomMenuItems():void {
     var zuozhe:ContextMenuItem = new ContextMenuItem("制作人");
     myContextMenu.customItems.push(zuozhe);
     var wangzhi:ContextMenuItem = new ContextMenuItem("博客",true);
     myContextMenu.customItems.push(wangzhi);
     var emaile:ContextMenuItem = new ContextMenuItem("邮箱",true);
     myContextMenu.customItems.push(emaile);
     var dizhi:ContextMenuItem = new ContextMenuItem("地址",true);
     myContextMenu.customItems.push(dizhi);
     var _close:ContextMenuItem = new ContextMenuItem("关闭",true);
     myContextMenu.customItems.push(_close);
     var _quanping:ContextMenuItem = new ContextMenuItem("全屏",true);
     myContextMenu.customItems.push(_quanping);
     wangzhi.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, wz);
     _close.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, gb);
     _quanping.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, qp);
    }
    function wz(event:ContextMenuEvent):void {
     var url:URLRequest=new URLRequest("http://blog.163.com/liu888chang@126/");
     navigateToURL(url,"_blank");
    }
    function gb(event:ContextMenuEvent):void {
     fscommand("quit");
    }
    function qp(event:ContextMenuEvent):void {
     stage.displayState="fullScreen";
     myContextMenu.customItems.pop();
     var _quanping:ContextMenuItem = new ContextMenuItem("退出全屏",true);
     myContextMenu.customItems.push(_quanping);
     _quanping.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, tcqp);
    }
    function tcqp(event:ContextMenuEvent):void {
     stage.displayState="normal";
     myContextMenu.customItems.pop();
     var _quanping:ContextMenuItem = new ContextMenuItem("全屏",true);
     myContextMenu.customItems.push(_quanping);
     _quanping.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, qp);
    }
    调用全屏功能代码需通过触发事件才可以运行的,如onPress,onRelease事件;
    在插入html 代码时需设置<param name="allowFullScreen" value="true" />;
    经多次研究发现,如 html代码设置成<param name="wmode" value="opaque" />或<param name="wmode" value="transparent" />时,则全屏功能无效!也就是说只有flash窗口模块设置为window时,全屏功能才有效。 
  • 相关阅读:
    spring整合mybatis错误:class path resource [config/spring/springmvc.xml] cannot be opened because it does not exist
    spring 整合Mybatis 《报错集合,总结更新》
    java_eclipse添加DID实现自动提示
    mbatis_逆向工程
    Spring《错误集合,总结更新》
    南山行 《重在坚持》
    mac OS 常用的一些快捷键
    object-c 语言特性@[] &@{}
    给textfield添加delegate的一种方法
    unwind segue
  • 原文地址:https://www.cnblogs.com/top5/p/2441159.html
Copyright © 2020-2023  润新知