How to trigger an event if the video is over? I’ld like to show a replay button then.
var vid:Video = new Video(480, 270);
vidcont.addChild(vid);
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
vid.attachNetStream(ns);
var listener:Object = new Object();
listener.onMetaData = function(evt:Object):void {};
ns.client = listener;
function playVideo(e:Event = null) {
ns.play("sneak.flv");
}
Thanks
Uli
Add the
NetStatusEvent.NET_STATUSevent on yourNetStreamobject and check for the “NetStream.Play.Stop” code.Example:
Then create the handler method:
If you need to check more than one code, it’s better to use a switch case instead of an if.