Do not use on any
shared computer
September 6, 2008 11:50pm pdt
 
[x]
Attachment Details

publish live video/audio stream

Tags: flash
I'm trying to stream my cam but I'm getting an error...

ArgumentError: Error #2126: NetConnection object must be connected.
      at flash.net::NetStream/construct()
      at flash.net::NetStream()
      at webcast_fla::MainTimeline/frame1()

How do I fix this and will the code below publish my camera?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
//publish stream
var livestream:NetConnection = new NetConnection();
livestream.objectEncoding = ObjectEncoding.AMF0;
livestream.client = this;
livestream.addEventListener( NetStatusEvent.NET_STATUS , netStatus );
livestream.connect("rtmp://domain/oflaDemo");
var hostStream:NetStream = new NetStream(livestream);
          hostStream.attachCamera(cam);
hostStream.publish("lecture", "live"); 
 
       function netStatus (event:NetStatusEvent):void
        {
 
            trace( event.info.code );
 
            if ( event.info.code == "NetConnection.Connect.Rejected" )
            {
 
                trace( event.info.application );
 
            }
			
			 if ( event.info.code == "NetConnection.Connect.Rejected" )
            {
 
                trace( event.info.application );
 
            }
    }
Start your free trial to view this solution
Question Stats
Zone: Software
Question Asked By: lowsky13
Question Asked On: 07.18.2008
Participating Experts: 1
Points: 500
Views: 0
Translate:
Loading Advertisement...
 
[+][-]Expert Comment by blue-genie

Rank: Sage

Expert Comment by blue-genie:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080723-EE-VQP-34 / EE_QW_2_20070628