Hi there,
I have written enough code to preview the webcam video in Flash.
Now, I want to capture images at 10 second intervals.
Here's my code:
import flash.display.BitmapData
import flash.geom.Matrix
import com.adobe.images.JPGEncoder;
import flash.net.FileReference;
//get the default camera
//change your Default camera using the Flash Player Settings.
cam=Camera.get()
//this event is called whenever permission to access the local camera, is accepted or denied by the user
cam.onStatus=function(e)
{
//if we are given permission
if(e.code == "Camera.Unmuted")
{
//start the application
initialize()
}
else
{
System.showSettings(3)
}
}
var snapshot:BitmapData=new BitmapData(cam._width,cam._height);
function takeSnapshot()
{
snapshot.draw(cam,new Matrix());
}
//if there are no Cameras
if(cam == null)
{
System.showSettings(3)
}
else
{
cam.setMode(1024, 768, 30);
cam.setQuality(10000,0);
output.attachVideo(cam);
setInterval(this,"takeSnapshot",1000);
}
Any help please?
I am a total Flash newbie.
Thanks, Rishi.