flash AS3.0 载入本地视频 自动播放完毕后自动跳入下一帧 (不要按钮)
展开全部
stop();
var MyVideo:Video = new Video();
addChild(MyVideo);
stage.addEventListener(MouseEvent.MOUSE_DOWN,SkipPlay);
var MyNC:NetConnection = new NetConnection();
MyNC.connect(null);
MyNC.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
var MyNS:NetStream = new NetStream(MyNC);
MyNS.play("around_movie.f4v");//视频名
MyVideo.attachNetStream(MyNS);
MyNS.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
function asyncErrorHandler(event:AsyncErrorEvent):void
{
}
function netStatusHandler(event:NetStatusEvent):void
{
switch (event.info.code)
{
case "NetStream.Play.Stop" :
MyVideo.visible = false;
gotoAndStop(2);
break;
}
}
function SkipPlay(e:MouseEvent):void
{
MyNS.pause();
MyVideo.visible = false;
gotoAndStop(2);
}
var MyVideo:Video = new Video();
addChild(MyVideo);
stage.addEventListener(MouseEvent.MOUSE_DOWN,SkipPlay);
var MyNC:NetConnection = new NetConnection();
MyNC.connect(null);
MyNC.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
var MyNS:NetStream = new NetStream(MyNC);
MyNS.play("around_movie.f4v");//视频名
MyVideo.attachNetStream(MyNS);
MyNS.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
function asyncErrorHandler(event:AsyncErrorEvent):void
{
}
function netStatusHandler(event:NetStatusEvent):void
{
switch (event.info.code)
{
case "NetStream.Play.Stop" :
MyVideo.visible = false;
gotoAndStop(2);
break;
}
}
function SkipPlay(e:MouseEvent):void
{
MyNS.pause();
MyVideo.visible = false;
gotoAndStop(2);
}
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询