title: Webcam resolution detection
body: <p>I just can't believe I've found NOTHING on google, I'm starting to think that may be a DUMB question, but I have to ask.</p>
  
  <p>I WANT to get the MAXIMUM RESOLUTION supported by a webcam, how can I do that?</p>
  
  <p>This is my actual code:</p>
  
  <pre><code> // Maximum amount of bandwidth that the current 
   // outgoing video feed can use, in bytes per second.
   var bandwidth:int = 0; 
   var quality:int = 100; // This value is 0-100 with 1 being the lowest quality. 
  
  
   var cam:Camera = Camera.getCamera();
   if(cam==null)
    writeErrorPopup(NOCAMERA_ERR);
   else
   {
    cam.addEventListener(StatusEvent.STATUS,statusHandler);
    function statusHandler(evt:StatusEvent):void
    {
     if(cam.muted)
     {   
      writeErrorPopup(CAMPERMISSION_ERR);
     }
     else
     {   
      trace(cam.width);
     }
    }    
  
   cam.setQuality(bandwidth, quality);
   //cam.setMode(640,480,30,false); 
   // setMode(videoWidth, videoHeight, video fps, favor area)
  </code></pre>
  
  <p>What I have understood is:</p>
  
  <ul>
  <li><p>default setMode of any webcam sets its resolution to 160x120, and infact the trace returns me the 160x120 value.</p></li>
  <li><p>if I uncomment the 640x480 setmode the trace returns me the 640x480 value, which is OK, but this is a static value, I want to understand WHICH is the webcam resolution..</p></li>
  </ul>
  
  <p>any hint?</p>