Hi, I made a cool effect, that you can play with! :cons:
Try change pointCount to something, and maxTimer!
Have fun!
// new fromPoint(x:Number, y:Number);
// drawBMP(fP:fromPoint,color:Color);
var pointCount:Number = 25;
var maxTimer:Number = 2000;
// -------------------------
var px:Number = Stage.width;
var py:Number = Stage.height;
var timer:Number = 0;
_quality = "LOW";
import flash.display.BitmapData;
var bmp:BitmapData = new BitmapData(px, py, false, 0x000000);
this.attachBitmap(bmp, this.getNextHighestDepth());
// ===============================================================================
var drawColor:Array = new Array(0xE1E1E1, 0xABDDFE, 0x1CA4FD, 0x016BB1);
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MovieClip.prototype.fromPoint = function(x, y) {
this.x = x;
this.y = y;
};
function drawBMP(fP, color) {
// ---- randomness ---- //
fP.x += (random(4)-1)-(random(3)-1);
fP.y += (random(9)-1)-(random(2)-1);
bmp.setPixel(fP.x, fP.y, color);
// - - - LOOP CHECK - - - - - - - - -
if (fP.x>px or fP.x<0 or fP.y>px or fP.y<0) {
fP.x = random(px);
fP.y = random(py);
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// drawers:
for (i=0; i<pointCount; i++) {
this["id"+i] = new fromPoint(random(px), random(py));
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
onEnterFrame = function () {
if (timer<maxTimer) {
timer++;
for (i=0; i<pointCount; i++) {
drawBMP(this["id"+i], drawColor[random(drawColor.length)]);
}
}
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -