2011-09-27 4 views

답변

0

AS3.

이미 videoPlayer 또는 일부 넷 스트림 및 메타 데이터 처리기가 있다고 가정합니다. 무대에 필요한 모든 항목이 있습니다.

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

당신을 환영합니다! –

관련 문제