FLV视频完成后跳帧

时间:2012-09-27 11:48:30

标签: actionscript-3 flash flv

所以我无法弄清楚这一点,我需要在FLV视频完成后跳回到帧(1)?

stop();
var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new NetStream(nc);
videoPlayer.attachNetStream(ns);

var listener:Object = new Object();
listener.onMetaData = function(evt:Object):void {};
ns.client = listener;

ns.play("Tchibo_movie.flv");

videoPlayer.addEventListener(Event.COMPLETE,completefunc);
function completefunc(e)
{
trace("completed");
gotoAndPlay (1);

}

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

你可以收听netstream

ns.addEventListener(NetStatusEvent.NET_STATUS, handleStreamStatus);
function handleStreamStatus(e:NetStatusEvent):void{ 
        trace(e.info.code); // for other stream status
        if(e.info.code == "NetStream.Play.Stop"){               
            trace('completed');
        }
}