ActionScript 3 网络摄像头与AS3

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ActionScript 3 网络摄像头与AS3相关的知识,希望对你有一定的参考价值。

package  {
	
	import flash.media.Camera;
	import flash.media.Video;
	
	
	public class CameraDemo extends Video {
		
		private var camera:Camera;
		private var camQuality:int = 80;
		private var fps:int = 30;
		
		public function CameraDemo(w:Number = 640, h:Number = 480) {
			/*	Set the width and height of the camera's display  */
			this.width = w;
			this.height = h;
			startCamera();
		}
		
		public function startCamera():void 
		{
			/*	Get the default camera for the system	*/
			camera = Camera.getCamera();
			/* Set the bandwidth and camera image quality	*/
			camera.setQuality(0, camQuality);
			/*	Set the size of the camera and frames per second   */
			camera.setMode(this.width, this.height, fps);
			/*	Attach the camera to the video object.. In this case the current class.  */
			this.attachCamera(camera);
		}
	}
}

以上是关于ActionScript 3 网络摄像头与AS3的主要内容,如果未能解决你的问题,请参考以下文章

ActionScript 3 AS3 SWFtrospection(as3swf)

ActionScript 3 AS3 TextField和StyleSheet示例(在ActionScript中创建)

[ActionScript 3.0] AS3.0 水面波纹效果

ActionScript 3 AS3:使用SWFObject2和AS3传递变量

ActionScript 3 克隆数组(AS3)

ActionScript 3 AS3序列化