Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6673985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:41:33+00:00 2026-05-26T03:41:33+00:00

i am having a very strange problem while linking a webcam i xperience following

  • 0

i am having a very strange problem while linking a webcam i xperience following error

ArgumentError: Error #2126: NetConnection object must be connected.
at flash.net::NetStream/ctor()
at flash.net::NetStream()

Following is my code in main.mxml

 <fx:Script>
   <![CDATA[
       import flash.media.Camera;
       import flash.media.Video;
       import flash.net.NetConnection;
       import mx.core.UIComponent;
       import com.kahaf.plutay.* ;    

       private var inVideo:Video;
       private var outVideo:Video;
       private var inVideoWrapper:UIComponent;
       private var camera:Camera;
       private var mic:Microphone;
       private var inStream:NetStream;
       private var outStream:NetStream;

       private function defaultVideoMode(): void
       {
          VideoPanel.width = 726;
           VideoPanel.height = 494;
           inVideo.width = 726;
           inVideo.height = 494;
       }

       private function showInComingVideo():void
       {
           inVideo = new Video(VideoPanel.width,VideoPanel.height);
           inVideo.attachNetStream(inStream);
           inVideoWrapper = new UIComponent();
           inVideoWrapper.addChild(inVideo);
           VideoPanel.addElement(inVideoWrapper);
           defaultVideoMode();
        }


       private function setupVideo(event:MouseEvent): void
       {
           camera = Camera.getCamera();
           mic = Microphone.getMicrophone();
           mic.setLoopBack(false); 
           mic.setUseEchoSuppression(true);
           camera.setMode(640,480,20);
           camera.setQuality(65536,90);

           var conn:NetConnection = Connection.getConnection().conn;

           inStream = new NetStream(conn);
           inStream.play(conn);
           showInComingVideo();
       } 
   ]]>

<s:Group x="283" y="330" width="234" height="149" id="VideoPanel" >
</s:Group>
<s:Button x="447" y="151" label="Click Me." click="setupVideo(event)"/>

here is the code of my connection class :

import flash.net.NetConnection;

public class Connection extends NetConnection
{
    public static var conObj:Connection;
    public var conn:NetConnection;
    public var target:Object;
    public var selector:Function;

    public function Connection()
    {
        conn = new NetConnection;
        target = null;
        selector = null;
        conn.client = this;
}

    public static function getConnection():Connection
    {
        if(conObj == null)
        {
            conObj = new Connection();
        }
            return conObj;
    }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:41:33+00:00Added an answer on May 26, 2026 at 3:41 am

    This the correct order when handling NetConnection and NetStreams:

    1. Create and establish the NetConnection (NetConnection.connect())
    2. Wait for the NetConnection.Connect.Success event (NetStatusEvent.NET_STATUS)
    3. Create your NetStream and attach the connected NetConnection to it
    4. Publish/play your stream
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a very strange problem with css3 border radius property. My following CSS
Im having a very strange problem, i have a complicated view that returns incorrect
I am having a very strange problem with pound signs displaying incorrectly (or not
I'm having a very strange problem. When I log stacktraces, they seem to be
I am having a very strange problem in a simple program and have been
I'm having a very strange problem where my execution jumps from semi-predictable locations to
I am having a strange problem while making an application in iPhone. The problem
Greetings everyone, I'm having a very strange problem. I've created a DateTextBox which automaticly
I'm having a very strange problem with XNA/OpenGL on Windows Phone 7. I'm drawing
I'm having a very strange problem that may be the result of my ignorance

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.