mattlundstrom
6/27/2012 - 11:05 PM

AS3 Dirty Video Listener

AS3 Dirty Video Listener

// Cuepoints for non flvs 

function dirtyVideoListener(_ns:NetStream, _time:Number, _func:Function)
{
	this.addEventListener(Event.ENTER_FRAME, checkTime);
	var callingMC:MovieClip = this;
	
	function checkTime():void
	{
		if (_ns.time > _time) 
		{
			_func();
			callingMC.removeEventListener(Event.ENTER_FRAME, arguments.callee);
		}
	}
}