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

Error #2044: Unhandled NetStatusEvent:. level=error, code=NetStream.Play.StreamNotFound

Guest
Aug 28, 2014 Aug 28, 2014

I'm trying to add a rtmp stream on my stage. But i'm getting the following error. I have added my code here. Please check my code here and suggest me how to fix the code.

Error:

NetConnection.Connect.Success

Error #2044: Unhandled NetStatusEvent:. level=error, code=NetStream.Play.StreamNotFound

    at main/attachnetstream()[/Users/user/Desktop/ojotha/main.as:27]

Code:

package  {

    import flash.display.MovieClip;

    import flash.net.*;

    import flash.events.NetStatusEvent;

    import flash.media.Video;

    import flash.events.Event;

    public class main extends MovieClip {

    public var streamserver:String="rtmp://216.245.200.114/live/";

    public var streamname:String="shomoy";

    public var netconnection:NetConnection=new NetConnection();

   

   

        public function main() {

            netconnection.connect(streamserver);

            netconnection.addEventListener(NetStatusEvent.NET_STATUS, attachnetstream);

       

       

           

        }

        public function attachnetstream(event:NetStatusEvent):void{

            trace(event.info.code);

            switch (event.info.code) {

                case "NetConnection.Connect.Success":

                var video:Video=new Video();

                var netstream:NetStream=new NetStream(netconnection);

                video.attachNetStream(netstream);

                netstream.play(streamname);

                video.height=480;

                video.width=640;

                addChild(video);

                break;

                case "NetStream.Play.StreamNotFound":

                trace("Stream not found: ");

                 break;

            }

                }

           

           

            }

       

    }

TOPICS
ActionScript
1.1K
Translate
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 ,
Aug 28, 2014 Aug 28, 2014
LATEST

if

  

netconnection.connect(streamserver);

is line 27, you're not connecting.

Translate
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