2014-03-05 76 views
0

我有一個問題,保持我的Flash播放器內置flex和as3的全屏使用osmf 我想在用戶的屏幕底部顯示面板欄。這應該適用於所有屏幕分辨率。我現在正在做的是在全屏幕上顯示視頻,但問題在於它沒有相應地調整視頻控制面板。 什麼我目前是這個在顯示屏幕底部顯示一個面板動作3

請幫我在這。

回答

0

我看不到代碼專用於您的代碼中的定位控件。當您創建可調整大小的組件時,主要想法是聽Event.RESIZE。這裏是一個小片段它如何工作的:

package { 

    import flash.display.Sprite; 
    import flash.display.StageAlign; 
    import flash.display.StageScaleMode; 
    import flash.events.Event; 

    public class StackOverflow extends Sprite { 
     private var _playerControls:VideoPlayerControls; 

     public function StackOverflow() { 
      addEventListener(Event.ADDED_TO_STAGE, onAdded); 
     } 

     private function onAdded(e:Event):void { 
      removeEventListener(Event.ADDED_TO_STAGE, onAdded); 


      stage.align = StageAlign.TOP_LEFT; 
      stage.scaleMode = StageScaleMode.NO_SCALE; 

      setup(); 
     } 

     private function setup():void { 
      //Main event that will help you reposition and resize your UI components 
      stage.addEventListener(Event.RESIZE, onResize); 

      _playerControls = new VideoPlayerControls(); 

      addChild(_playerControls) 
     } 

     private function onResize(e:Event):void { 
      _playerControls.updateWidth(stage.stageWidth); 
      _playerControls.y = stage.stageHeight - _playerControls.height; 
     } 

    } 
} 

import flash.display.Sprite; 

internal class VideoPlayerControls extends Sprite { 

    public function VideoPlayerControls() { 
     this.graphics.beginFill(0x333333); 
     this.graphics.drawRect(0, 0, 100, 40); 
    } 

    internal function updateWidth(width:int):void { 
     //Do logic with reposition and resizing components 
     this.width = width; 
    } 
} 

舞臺屬性alignscaleMode應該在你啓動視頻播放器一次進行設置。

+0

非常感謝您的回覆。 嗯,如果你能幫到,我還有其他問題。我的廣播公司沒有使用Chrome瀏覽器,但是在Firefox和任何其他瀏覽器中完美工作。我已經嘗試了一切,發現它由於胡椒閃光插件已經內置鉻。那麼我該如何處理這個問題。我遇到的問題是它不允許點擊Flash安全設置選項。任何幫助將不勝感激 –

+0

安全窗口界面非常有限。在各種瀏覽器中有一些錯誤(不可點擊其中之一...),特別是在Mac下。我可以推薦在Adobe Bug Tracker中添加這個bug。 –