//This is a recurrent function who calls itselft playagain(yourflvfile); function playagain(flvfile) { function playagain(flvfile) { ns = new NetStream(netConn); theVideo.attachVideo(ns); ns.play(flvfile); ns.onStatus = function(infoObject) { if (infoObject.code == "NetStream.Play.Stop") { ns.close; playagain(flvfile); } } }