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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:43:02+00:00 2026-05-31T14:43:02+00:00

Im trying to understan a function that I found on the web. Iknow what

  • 0

Im trying to understan a function that I found on the web.
Iknow what the function does, It get the information about the webcam in your computer and post it on the textArea,

But the individual line are just a bit confused.

Any help ?

Thanks

private var camera:Camera;
private function list_change(evt:ListEvent):void {
var tList:List = evt.currentTarget as List;
var cameraName:String = tList.selectedIndex.toString();
camera = Camera.getCamera(cameraName);
textArea.text = ObjectUtil.toString(camera);
}
  • 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-31T14:43:03+00:00Added an answer on May 31, 2026 at 2:43 pm
    private var camera:Camera;
    

    This line creates a variable of the class type Camera. It does not create an instance of the variable.

    private function list_change(evt:ListEvent):void {
    

    This line is a standard function heading. Because the argument is a ListEvent, it makes me think that this function is probably written as an event handler. Because of the name of the function, it is most like listening to the change event on a list.

    var tList:List = evt.currentTarget as List;
    

    This line creates a reference to the list that dispatched the event, which caused this handler to be executed.

    var cameraName:String = tList.selectedIndex.toString();
    

    This line converts the selectedIndex to a string. It’s a bit odd to convert an index to a string, as opposed to some value. But the reason they do that looks to be on the next line..

    camera = Camera.getCamera(cameraName);
    

    This uses that camera variable (defined back in line 1) and actually gets an instance of the camera. It uses the “cameraName” which makes me think that the list that dispatched this change event contains a list of cameras available on the system.

    textArea.text = ObjectUtil.toString(camera);
    

    This converts the camera object to a string and displays it in a text area. Normally you wouldn’t try to do this as it provides no valuable data. A default object will display strings as [Object object] or something similar. Perhaps the camera object has a custom string function; I don’t have experience with that. Normally, you’d want to access properties of the object to get useful information, not try this on the object itself.

    }
    

    This line is the end of the function. The open bracket was in the 2nd line of code in the function definition.

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

Sidebar

Related Questions

I am trying to call a function that SELECTS values from my Web SQL
i was trying to create a function that takes a list of lists an
I am trying to get this method in a String Filter working: public function
I'm trying to call a function with a variable name that is generated at
So I'm trying to create a function that takes in an array (I guess
I'm trying to get the hang of UITableViews and everything that goes with it.
I found this code here while trying to understand what an actionstack does and
I'm trying to understand why $('#title').replaceWith('ha'); will work outside the drop: function(event, ui) {}
This matrix transposition function works, but I'm trying to understand its step by step
Just trying to understand that - I have never used it before. How is

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.