2011-09-27 78 views

回答

0

AS3。

我認爲你已經有一個videoPlayer或一些netstream和元數據處理程序。並且你在舞臺上擁有所有需要的物品。

var playProgressTimer:Timer; 
var movieClip:MovieClip; 

function handlePlayButtonClicked (e : MouseEvent) : void 
{ 
    playProgressTimer = new Timer(100); 
    playProgressTimer.addEventListener(TimerEvent.TIMER, onPlayProgressTick); 
    playProgressTimer.start(); 
} 

function onPlayProgressTick (e : TimerEvent) : void 
{ 
if (!netStream || !metaData) 
    return; 
    // getting the progress of the video 
    var _playProgress:Number = netStream.time/metaData.duration; 
    // setting the same progress to the movieclip you have. 
    movieClip.gotoAndStop(int(_playProgress * movieClip.totalFrames)); 
} 
+0

非常感謝! –

+0

不客氣! –