播放器中常用:右键菜单全屏与退出全屏的切换[AS3]
怎么才能使右键菜单选项文字在点击一下后,再出现时文字改变,就是要做个右键菜单全屏选项,点击全屏,再右击菜单出现时原来的全屏选项文字 变为退出全屏,如此反复
怎么才能使右键菜单选项文字在点击一下后,再出现时文字改变,就是要做个右键菜单全屏选项,点击全屏,再右击菜单出现时原来的全屏选项文字 变为退出全屏,如此反复/舞台设置?以下是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);
- }
热门文章推荐
- 纯HLS(m3u8)跨平台技术(HLSPlayer,m3u8Player跨平台多终端)
- DiscuzX3.2酷播视频插件(dz论坛自定义视频插件带广告
- [微信视频]实现网站中的视频在微信平台上正常播放(超多组图)
- [rtsp]海康威视监控摄像头实现web端无插件监控实拍效果
- 很酷,酷播wordpress视频插件(支持PC/安卓/苹果跨平台播放)
- [组图]微信视频技术:支持微信视频直播和视频点播
- [AS3]as3.0的rtmp流媒体播放器写法源代码示例
- 一步一步教你制作FLV网页视频播放器
请稍候...