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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:01:53+00:00 2026-05-18T20:01:53+00:00

I am having a lot of problems with setting up a webcam connection. I

  • 0

I am having a lot of problems with setting up a webcam connection.
I read that I should use a class for the connection, so that the onBWDone() method is defined and I don’t get an error about this method.

The actionscript class:

package cam  {
    public class WebcamSetup {

    public var appURL:String;

    public function setConnection():NetStream 

    {
        nc:NetConnection = new NetConnection();
        nc.client = this;
        nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
        nc.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onAsyncError);
        nc.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
        nc.connect(appURL);

        ns:NetStream = new NetStream(nc);

        return ns;
    }

    public function onBWDone():void{
    }
    }
}

In the flash file, I do this:

import cam.WebcamSetup;

var wc:WebcamSetup = new WebcamSetup();
wc.appURL = "rtmp://xxxxx";

var nss:NetStream = wc.setConnection();

var camera = Camera.getCamera();

if (camera != null){

    myVid.attachCamera(camera);

    nss.attachCamera(camera);
}

I get loads of “undefined method” and “undefined property” errors.
And can I not do a return like this? I get the error “return value must be undefined”.

  • 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-18T20:01:53+00:00Added an answer on May 18, 2026 at 8:01 pm

    The first problem I see is that your function setConnection has the return type void (which means that the function returns nothing).

    public function setConnection():void
    

    should be

    public function setConnection():NetStream
    

    Then AS3 knows that the object returned from the setConnection function will be of the type NetStream.

    It would be useful if you pasted the errors you’re getting.

    Is getCamera a static function within the Camera class? It’s hard to know what’s happening.

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

Sidebar

Related Questions

I am having a lot of problems with setting up a webcam connection. I
I have read about a lot of people having problems with the browser not
I know that a lot of people on the Internet have expressed having problems
I've been having a lot of problems trying to figure out how to use
I'm having a lot of problems with this one. When I try using easy_install,
I'm having a lot of problems initializing an array of bools. When using the
Lately we been having a lot of problems with our mysql server i have
I have been having lot of problems with users uploading images on my website.
I was having a lot of problems with the facebook SDK. I've managed through
I am having a lot of problems with the behaivour of the socket (not

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.