Skip to content

Instantly share code, notes, and snippets.

@mattlundstrom
Last active August 29, 2015 14:19
Show Gist options
  • Select an option

  • Save mattlundstrom/8c45ac52b71791db5505 to your computer and use it in GitHub Desktop.

Select an option

Save mattlundstrom/8c45ac52b71791db5505 to your computer and use it in GitHub Desktop.
Dirty Video Listener 2
// Cuepoints for non flvs
var dirtyVideoListerner:Function = function (_ns:NetStream, _time:Number, _func:Function):void
{
this.addEventListener(Event.ENTER_FRAME, checkTime);
var callingMC:MovieClip = this;
function checkTime():void
{
if (_ns.time > _time)
{
_func();
cancel();
}
}
function cancel()
{
callingMC.removeEventListener(Event.ENTER_FRAME, arguments.callee);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment