import fl.video.FLVPlayback; //控制視訊檔播放的類別 import fl.video.MetadataEvent; //與視訊提示點相關 import fl.video.VideoEvent; //與視訊播放相關的事件類別 myPlayer.autoRewind = true; //設定會自動回頭播放 //新增視訊提示點: 設定字幕 myPlayer.addASCuePoint(0.15,"導遊"); myPlayer.addASCuePoint(3.15,""); myPlayer.addASCuePoint(4.15,"可愛歐洲小孩"); function textOn(event:MetadataEvent):void { video_txt.text = event.info.name; } myPlayer.addEventListener(MetadataEvent.CUE_POINT,textOn); function theEnd(event:VideoEvent):void { //bready_mc.stop(); } myPlayer.addEventListener(VideoEvent.COMPLETE, theEnd); // 設定播放按鈕 function toPlay(event:MouseEvent):void { myPlayer.play(); //bready_mc.play(); } play_btn.addEventListener(MouseEvent.MOUSE_DOWN, toPlay); // 設定暫停按鈕 function toPause(event:MouseEvent):void { myPlayer.pause(); //bready_mc.stop(); } pause_btn.addEventListener(MouseEvent.MOUSE_DOWN, toPause); // 設定停止按鈕 function toStop(event:MouseEvent):void { myPlayer.stop(); //bready_mc.stop(); video_txt.text = ""; } stop_btn.addEventListener(MouseEvent.MOUSE_DOWN, toStop);