1. 將FLVPlayBack拉入元件庫中(可用ctrl+F7呼叫組件視窗)
2. 在as內貼入下列代碼
//導入video類別
import mx.video.*;
//設定Player所使用的面板。這邊要注意,面板的swf檔需要一齊被上傳!! //例如你使用SteelExternalAll.swf這個面板,那就需要將SteelExternalAll.swf與你所做出的swf檔案放在同個資料夾
Player.skin = “SteelOverAll.swf”;
//是否根據影片大小縮放組件
Player.autoSize=false;
//設定其他按鈕(這些也是從組件裡拉)
Player.playButton = playbtn;
Player.pauseButton = pausebtn;
Player.playPauseButton = playpausebtn;
Player.stopButton = stopbtn;
Player.muteButton = mutebtn;
Player.backButton = backbtn;
Player.forwardButton = forbtn;
Player.volumeBar = volbar;
Player.seekBar = seekbar;
Player.bufferingBar = bufbar;
//是否當bufferingBar失效時要無效化其他按鈕
Player.bufferingBarHidesAndDisablesOthers = true;
//指定要撥放的影片路徑
Player.contentPath = “http://www.helpexamples.com/flash/video/water.flv”;
3. 修改SeekBar款式,assets第二格為指標的款式
this.handleLeftMargin = 2; //左邊留的空隙
this.handleRightMargin = 2; //右邊留的空隙
this.handleY = 11; //指標的位移,預設值是11,代表會在SeekBar的下面
ps: 此組件的面板也可自行製作,
面板檔案都放在zh_tw\Configuration\FLVPlayback Skins的資料夾底下
有Flv檔,可供我們編修,再直接匯入
補充: 若要讓影片可以全螢幕,則需使用as3.0來做,也就是該改成
import fl.video.FLVPlayback;
my_FLVPlybk.playPauseButton = my_plypausbttn;
my_FLVPlybk.stopButton = my_stopbttn;
my_FLVPlybk.backButton = my_bkbttn;
my_FLVPlybk.seekBar = mySeekBar;
my_FLVPlybk.bufferingBar = myBufferingBar;
my_FLVPlybk.forwardButton = my_fwdbttn;
my_FLVPlybk.volumeBar = myVolumeBar;
my_FLVPlybk.muteButton = myMuteButton;
my_FLVPlybk.fullScreenButton=my_FullScreenButton;
my_FLVPlybk.source = “water.flv”;
此組件的詳細說明文件如下:http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/video/FLVPlayback.html