A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Help. What is Error #2126

  1. #1
    Join Date
    Jul 2008
    Manhattan, New York City. (New York City??)

    Help. What is Error #2126

    I moved some code that works perfect on the Actions layer, into a class, and I get this error.

    ArgumentError: Error #2126: NetConnection object must be connected.

    can anyone help me? I can't seem to find any good documentation on this one.


  2. #2
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    press the picture...
    You would get the error if you
    1. forgot to connect (this line)
    nc.connect (null);

    or 2. misplaced the line:
    nc = new NetConnection();
    ns = new NetStream(nc);
    nc.connect (null);

    or 3. if you instantiate the the NetConnection and NetStream when you declare the variables:
    private var nc:NetConnection = new NetConnection();
    private var ns:NetStream = new NetStream(nc);

    Correct order:
    nc = new NetConnection();
    nc.connect (null);
    ns = new NetStream(nc);
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center