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 7955205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:39:37+00:00 2026-06-04T03:39:37+00:00

I am trying to capture my web cam and then try to save it

  • 0

I am trying to capture my web cam and then try to save it to the red5 server ,and then i want to retrieve it back(thats the next part).I am able to play the web cam on my web page using the Flash but i am not able to record the video to the red5 server.Every time i am getting the exception

ArgumentError: Error #2126: NetConnection object must be connected.
    at flash.net::NetStream/flash.net:NetStream::construct()
    at flash.net::NetStream$iinit()
    at WebCam_fla::MainTimeline/click1()
onBWDone

My AS3 is as follows:

BtnStart.addEventListener(MouseEvent.CLICK, click1);
BtnStop.addEventListener(MouseEvent.CLICK, click2);
var camera;
var video;
var bandwidth:int = 100;
var quality:int = 100;
var nc:NetConnection;
var ns:NetStream;
function click1(event:MouseEvent):void 
{

camera=Camera.getCamera();
camera.setMode(320,240,10000);
video = new Video(camera.width, camera.height);
video.attachCamera(camera);
video.smoothing;
txtCameraName.text=camera.name;
nc = new NetConnection();
nc.client = { onBWDone: function():void{ trace("onBWDone") } };
addChild(video);


nc.connect("rtmp://localhost/oflaDemo");
ns = new NetStream(nc); 
ns.attachCamera(camera);
ns.publish( "file1", "record" );

}   

function click2(event:MouseEvent):void
{

    if(video)
    {
    video.visible=false;
    }
}

Can anyone please tell me that what mistake i am committing here.Please guys help me.Do i have to do any other stuff to make this happen.Do i have to changed the link which i am giving in the line nc.connect(“rtmp://localhost/oflaDemo”);.This is the line which is giving me the error.Please help.Any help will be appreciated.

  • 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-06-04T03:39:39+00:00Added an answer on June 4, 2026 at 3:39 am

    I was doing the mistake of creating the stream before the connection was established.So made a slight change in the code to check if the connection is made then only creating the stream with the connection.That solved my problem.Cheers 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to save image captured from web cam with current time.Like 06.06.2010
I'm trying to capture all the URLs requested to WAS. I'm running a web
I am trying to develop a web application for which I need to capture
Greetings, I'm trying to play with live web cam using asp.net with C#. I
Hi I am trying to detect web cam in opencv using following code I
I'm working on a web application where I'm trying to capture when the user
I have a web service (.svc), and I am trying to capture the SOAP
I am trying to capture web service response via Groovy client, I have to
I'm trying to write a web part that will log some performance metrics to
I am trying to capture the microphone and send the recording to my server..

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.