国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 應用 > 影音媒體 > 正文

FLV視頻類播放器全屏切換完整AS代碼示例

2020-07-15 14:17:01
字體:
來源:轉載
供稿:網友
  1. function setFullScreen() {  
  2. //fscommand("fullscreen", true);  
  3. if (_root.logoCoolRabbit._visible == false) {  
  4.    if (Stage["displayState"] == "normal") {  
  5.     fscommand("fullscreen", true);  
  6.     Stage["displayState"] = "fullScreen";  
  7.    } else if (Stage["displayState"] == "fullScreen") {  
  8.     fscommand("fullscreen", false);  
  9.     Stage["displayState"] = "normal";  
  10.    }  
  11.    rootWidth = Stage.width;  
  12.      rootHeight = Stage.height;  
  13.  
  14.    //復位控制欄  
  15.    clearInterval(controlBuffCoolTime);  
  16.    controlBuffCoolTime = null;  
  17.    clearInterval(controlBuff);  
  18.    controlBuffCool = 0;  
  19.    controlBuffEstimate = null;  
  20.  
  21.    //復位標題欄  
  22.    clearInterval(playTitleBuffCoolTime);  
  23.    playTitleBuffCoolTime = null;  
  24.    clearInterval(playTitleBuff);  
  25.    playTitleBuffCool = 0;  
  26.    playTitleBuffEstimate = null;  
  27.  
  28.    //重新設置組件位置  
  29.    moduleSet();  
  30.  
  31.    //重新計算和設置播放組件尺寸比  
  32.    videoWidthSet = rootWidth;  
  33.    videoHeightvideoHeightSet = videoHeight/videoWidth*rootWidth;  
  34.    playAllModule.playFlvWindow._width = videoWidthSet;  
  35.    playAllModule.playFlvWindow._height = videoHeightSet;  
  36.    playAllModule.playFlvWindow._y = (rootHeight-playAllModule.playFlvWindow._height)/2;  
  37. }  
  38. }  
  39.  
  40. //全屏模式切換  
  41. playAllModule.controlSet.buttonFullScreen.onPress = function() {  
  42. setFullScreen();  
  43. };  
  44.  
  45. //創建右鍵全屏及退出全屏菜單  
  46. //var newnewMenu:ContextMenu = new ContextMenu();  
  47. var newnewMenu:ContextMenu = new ContextMenu(menuHandler);  
  48. //隱藏右鍵的一些標準菜單  
  49. newMenu.hideBuiltInItems();  
  50. // 在右鍵菜單中加入菜單項  
  51. //var fs:ContextMenuItem = new ContextMenuItem("全屏", goFullScreen);  
  52. var fs:ContextMenuItem = new ContextMenuItem("全屏", setFullScreen);  
  53. newMenu.customItems.push(fs);  
  54. //var xfs:ContextMenuItem = new ContextMenuItem("退出全屏", exitFullScreen);  
  55. var xfs:ContextMenuItem = new ContextMenuItem("退出全屏", setFullScreen);  
  56. newMenu.customItems.push(xfs);  
  57. // 現在將右鍵菜單指定給場景中的movieclip.我當前指定給場景中的box.你也可以指定給_root  
  58. this.menu = newMenu;  
  59.  
  60. /**  
  61. function goFullScreen() {  
  62. //Stage["displayState"] = "fullScreen";  
  63. }  
  64. function exitFullScreen() {  
  65. //Stage["displayState"] = "normal";  
  66. }  
  67. **/  
  68.  
  69. // 定義開啟和關閉全屏功能,取決于你當前處于哪一種狀態下  
  70. function menuHandler(obj, menuObj) {  
  71. if (Stage["displayState"] == "normal") {  
  72.    // 如果你當前處在正常模式下,則goFullscreen可點擊  
  73.    menuObj.customItems[0].enabled = true;  
  74.    menuObj.customItems[1].enabled = false;  
  75. } else {  
  76.    // 如果你當前片在全屏模式下,則exitFullScreen可點擊  
  77.    menuObj.customItems[0].enabled = false;  
  78.    menuObj.customItems[1].enabled = true;  
  79. }  

flash播放器軟件下載列表:

      flash播放器大全下載中心    最新版flash播放器下載        
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 富裕县| 博爱县| 蓬安县| 禹州市| 阆中市| 壤塘县| 会宁县| 云梦县| 延川县| 教育| 丰都县| 肇庆市| 宁城县| 钟山县| 明水县| 西充县| 霍林郭勒市| 个旧市| 巍山| 温泉县| 河南省| 济宁市| 惠安县| 太原市| 平塘县| 黄龙县| 黎城县| 香河县| 庆城县| 祁连县| 鱼台县| 河曲县| 临邑县| 敖汉旗| 长治市| 昌江| 勐海县| 聂拉木县| 隆尧县| 乐都县| 池州市|