Effects
There is a camera to test Oh!!
Here's the code:
var Cam:camera = Camera.get ();
Cam.setmode (Cam.width, Cam.height, 25);
Video.attachvideo (CAM);
var depth_num:number = 0;
var List_array:array;
List_array = new Array ();
m = new Flash.geom.Matrix ();
now = new Flash.display.BitmapData (video._width, video._height);
out = new Flash.display.BitmapData (video._width, video._height);
This.createemptymovieclip ("OUT_MC", 50);
Out_mc.attachbitmap (out, 1);
out_mc._x = 160;
This.onenterframe = function () {
Now.draw (video, M);
Done = Now.clone ();
Done.draw (before, M, null, "difference");
Done.threshold (Done, Done.rectangle, Done.rectangle.topLeft, ">", 4.279309E+009, 4.294902E+009, 16777215, false);
List_array.push (Done.clone ());
if (list_array.length>5) {
List_array.shift (). Dispose ();
}
var r_num9 = list_array.length;
var r_num8 = 255;
var r_num7;
Out.fillrect (out.rectangle, 0);
Before = Now.clone ();
for (var c:number = 0; c<r_num9; C + +) {
R_NUM7 = C*R_NUM8;
Out.threshold (List_array[c], Out.rectangle, out.rectangle.topLeft, "= =", 4.294902E+009, -16777216 | r_num7 << 16 | 0 | 0, 16777215, false);
}
depth_num++;
Attachmovie ("Pao_mc", "PAO_MC" +depth_num, depth_num+100, {_x:math.random () *550, _y:math.random () *400, _xspeed:3-( Math.random () *6+1), _yspeed:math.random () *3+1, _scale:math.random () *20+20});
var color:color = new Color (this["PAO_MC" +depth_num));
Color.setrgb (Math.random () *0xffffff);
this["PAO_MC" +depth_num]._xscale = this["PAO_MC" +depth_num]._yscale=this["PAO_MC" +depth_num]._xscale._scale;
this["PAO_MC" +depth_num].onenterframe = function () {
This._xscale + = THIS._SCALE/60;
This._yscale = This._xscale;
This._alpha = 166-this._xscale;
Trace (Out.getpixel (this._x, this._y));
if (Out.getpixel (this._x, this._y) <=0) {
This._x-= This._xspeed;
This._y-= This._yspeed;
}
if (this._x<=0 | | this._y<=0 | | this._x>=550) {
This.removemovieclip ();
}
};
};
Stop ();
Source file Download: Click here to download source files