• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

close netSream fails

Explorer ,
Mar 02, 2014 Mar 02, 2014

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

TOPICS
ActionScript

Views

502

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 02, 2014 Mar 02, 2014

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{

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 02, 2014 Mar 02, 2014

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 02, 2014 Mar 02, 2014

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines