Copy link to clipboard
Copied
hi
i have event listener in the main function:
netStream.addEventListener(NetStatusEvent.NET_STATUS, statusUpdated);
and function as follows:
public function statusUpdated(e:NetStatusEvent):void
{
trace(e.info.code)
switch (e.info.code)
{
case "NetStream.Play.Stop":
video.clear();
gotoAndStop(1)
break;
}
}
however i get the following error:
ReferenceError: Error #1069: Property onPlayStatus not found on Main and there is no default value.
Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095: flash.net.NetStream was unable to invoke callback onPlayStatus. error=ReferenceError: Error #1069: Property onPlayStatus not found on Main and there is no default value.
at Main()[/Users/test/Desktop/add_complete/Main.as:408]
NetStream.Buffer.Empty
need assistance
thanks
Copy link to clipboard
Copied
the title of your post and the error messages and the code you showed all appear to be unrelated to each other.
so, i'm not sure what you want but if you want to resolve that error you need to define onPlayStatus. that's a property of your netsteam's client object:
netStream.client=this;
function onPlayStatus(eObj:Object):void{
}
Copy link to clipboard
Copied
thank you.
simply, i have a video created with netstream and i want to close it when it is completed.
Copy link to clipboard
Copied
Apparently you are invoking RTMP stream. NetStream with streaming media behaves differently from progressive playback. In particular, server can invoke additional methods on NetStream instance.
FMS (or whatever server your video originates from) in your case is trying to call onPlayStatus() method on NetStream.client. This ia standard server behavior. With RTMP NetStream does not dispatch NetStatus Event with code NetStream.Play.Stop. Instead, again, server calls onPlayStatus() with code NetStream.Play.Complete.
Thus, as kglad suggested, you need to implement public method onPlayStatus() in your code.