Frame 1
function initialize() {
list = new Array();
m = new flash.geom.Matrix();
m.scale(output._xscale / 100, output._yscale / 100);
now = new flash.display.BitmapData(output._width, output._height);
out = new flash.display.BitmapData(output._width, output._height);
this.createEmptyMovieClip("output_mc", this.getNextHighestDepth());
output_mc.attachBitmap(out, 1);
output_mc._x = output._width;
output_mc._y = output._y;
setInterval(this, "snap", 100);
}
function snap() {
now.draw(output, m);
done = now.clone();
done.draw(before, m, null, "difference");
done.threshold(done, done.rectangle, done.rectangle.topLeft, ">", 4279308561, 4278255360, 16777215, false);
list.push(done.clone());
if (list.length > max) {
list.shift().dispose();
}
var _local3 = list.length;
var _local4 = 255 / _local3;
var _local2;
out.fillRect(out.rectangle, 4278190080);
before = now.clone();
var _local1 = 0;
while (_local1 < _local3) {
_local2 = _local4 * _local1;
out.threshold(list[_local1], out.rectangle, out.rectangle.topLeft, "==", 4278255360, (-16777216 | (_local2 << 8)) | 0, 16777215, false);
_local1++;
}
}
max = 7;
cam = Camera.get();
cam.onStatus = function (e) {
if (e.code == "Camera.Unmuted") {
initialize();
} else {
System.showSettings(3);
}
};
if (cam == null) {
System.showSettings(3);
} else {
output.attachVideo(cam);
}