<button id="ptu4h"><acronym id="ptu4h"><input id="ptu4h"></input></acronym></button>

<tbody id="ptu4h"></tbody>

    <dd id="ptu4h"><center id="ptu4h"></center></dd><dd id="ptu4h"></dd><dd id="ptu4h"><track id="ptu4h"><video id="ptu4h"></video></track></dd>
  • 16素材
    您現在的位置:首頁 > 教程中心 > Flash教程

    右鍵菜單全屏和退出全屏的互變(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("郵箱liu888chang@126.com",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);
    }

    關鍵詞: 右鍵菜單全屏退出

    相關素材

    聯系客服 加入QQ群
    素材中国