视频播放完毕后AS3 gotoAndPlay

时间:2012-04-03 18:35:40

标签: actionscript-3 video

我已加载了此代码的视频

var video:Video = new Video(1440, 900);
addChild(video);

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

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

var listener:Object = new Object();
listener.onMetaData = function(e:Object):void {};
ns.client = listener;
ns.play("introAPOK_blanco.f4v");

现在我需要在视频播放结束后执行“gotoAndPlay”转到另一个帧或场景

谢谢!

1 个答案:

答案 0 :(得分:0)

video.addEventListnere("complete", onPlayFinished);

function onPlayFinished(event:Event):void
{
    //Video playback finished
}

更新1:

  1. 查看本教程http://www.adobe.com/devnet/flash/articles/flvplayback_programming.html
  2. 而不是“完成”使用VideoEvent.COMPLETE