2011-09-27 46 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

不客气! –