我就在这里
分类:
2010-08-13 08:08:38
01 : //检查摄像头 02 : function CheckForCam() { 03 : camArray = Camera.names; 04 : if (camArray.length >= 1){ 05 : temp_cam = Camera.get(); 06 : if(temp_cam == -1) { 07 : trace('--- cam is detected but its busy'); 08 : return -1; } 09 : else { 10 : trace('--- cam detected'); 11 : return 1; } 12 : delete temp_cam; 13 : } else if (camArray.length == 0) { 14 : trace('--- no cam detected'); 15 : return 0; 16 : } 17 : } 18 : 19 : 20 : // 检查麦克风 21 : function CheckForMic() { 22 : micArray = Microphone.names;; 23 : if (micArray.length >= 1){ 24 : temp_mic = Microphone.get(); 25 : if(temp_mic == -1) { 26 : trace('--- mic is detected but its busy'); 27 : return -1; } 28 : else { 29 : trace('--- mic detected'); 30 : return 1; } 31 : delete temp_mic; 32 : } else if (micArray.length == 0) { 33 : trace('--- no Mic detected'); 34 : return 0; 35 : } 36 : } |