Using the Web Camera in Actionscript 3
Using the Cam is a fast process in AS3
Request for the classes to be used in this example :
import flash.media.Camera;
import flash.media.Video;
function loadCam(){
var camera:Camera = Camera.getCamera();
var video:Video = new Video();
camera.setMode(600,300,15,true);
camera.setQuality(0, 100);
video.attachCamera(camera);
video.width = camera.width;
video.height = camera.height;
camera.setMotionLevel(10, 1000);
addChild(video);
}
loadCam();
Using the Cam is a fast process in AS3
Request for the classes to be used in this example :
import flash.media.Camera;
import flash.media.Video;
As allways import your classes
import flash.events.*;
import flash.media.Microphone;
import flash.system.Security;
var _stream:NetStream;
var _video:Video;
var _playbackTime:Textfield;
var _duration:uint;
function loadVideo()
Create a Rectangle on Stage and Convert to movieClip by selecting the object & pressing F8 Once object is created add an Instance Name of rectangle. Add the Script bellow to an actionscript layer to keep your layers in order.
Create a circle on Stage and Convert to movieClip by selecting the object & pressing F8 Once object is created add an Instance Name of dragCircle. Add the Script bellow to an actionscript layer to keep your layers in order.
Create an object on Stage and Convert to movieClip by selecting the object & pressing F8 Once object is created add an Instance Name of objectScaleXY Add the Script bellow to an actionscript layer to keep your layers in order
Create an object with instance name of movieMove and create a function
to execute the tweening.
Send a request for the classes to use
import flash.display.Loader;
import flash.events.Event;
import flash.net.URLReqest;
As allways import all the classes that you will be needing to ahead of the application
import flash.display.Sprite;
import flash.events.*;
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;