1

I have problems in webcam recognition on my Flash app (written in Actionscript 3).

I get webcam source using:

Camera.getCamera();

but on some PC it doesn't work. In particular, some webcam gets LED on but getCamera() still returns false. How is it possible?

4

1 回答 1

0

这应该有效:

package {
import flash.display.Sprite;
import flash.media.Camera;
import flash.media.Video;

public class CameraController extends Sprite {
    private var cam:Camera = Camera.getCamera();
    private var vid:Video = new Video(); 

    public function CameraController() {
        connectCamera();
    }


    private function connectCamera():void {
        vid.attachCamera(cam); 
        addChild(vid);
    }
}
}

您可以在此处阅读有关使用相机的更多信息:http: //help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content= 00000867.html

于 2013-10-13T11:48:47.823 回答