blobber
lo vi en foro aleman,..pero yo no se de action,...q esta mal, aqui esta el codigo,...
http://www.flashforum.de/forum/showthread.php?s=&threadid=55045
--------------------
createRegisteredEmptyMovieClip = function (base, name, depth, class, args) {
var MC_prototype = MovieClip.prototype;
MovieClip.prototype = class.prototype;
base.createEmptyMovieClip(name, depth);
class.apply(base[name], args);
MovieClip.prototype = MC_prototype;
};
//########################################
//
function MyBlob(nr, radius, x, y, col) {
this.nr = nr;
this._x = x;
this._y = y;
this.drawCircle(radius, 0, 0, col);
}
MyBlob.zielx = [];
MyBlob.ziely = [];
MyBlob.prototype = new MovieClip();
MyBlob.prototype.drawCircle = function(r, x, y, c) {
var rx = r + x, ry = r + y, xr = x - r, yr = y - r;
var r07 = r * 0.7071, r04 = r * 0.4142;
with (this) {
moveTo(rx, y);
beginFill(c, 100);
curveTo(rx, r04 + y, r07 + x, r07 + y);
curveTo(r04 + x, ry, x, ry);
curveTo(x - r04, ry, x - r07, r07 + y);
curveTo(xr, r04 + y, xr, y);
curveTo(xr, y - r04, x - r07, y - r07);
curveTo(x - r04, yr, x, yr);
curveTo(r04 + x, yr, r07 + x, y - r07);
curveTo(rx, y - r04, rx, y);
endFill();
}
};
MyBlob.prototype.randomChange = function() {
this.randomInt = setInterval(this, "randomPos", 5000 + random(5000));
};
MyBlob.prototype.randomPos = function() {
MyBlob.zielx[this.nr] = random(Stage.width);
MyBlob.ziely[this.nr] = random(Stage.height);
};
MyBlob.prototype.onEnterFrame = function() {
var deltax = MyBlob.zielx[this.nr] - this._x;
var deltay = MyBlob.ziely[this.nr] - this._y;
this._x += deltax / 300;
this._y += deltay / 300;
};
//
//
for (var i = 0; i < 20; i++) {
var scal = 20 + random(300);
createRegisteredEmptyMovieClip(this, 'mc_a' + i, i + 400, MyBlob, [i, 50, 300, 200, 0xff0000]);
createRegisteredEmptyMovieClip(this, 'mc_b' + i, i + 300, MyBlob, [i, 56, 300, 200, 0xdd0000]);
createRegisteredEmptyMovieClip(this, 'mc_c' + i, i + 200, MyBlob, [i, 62, 300, 200, 0xbb0000]);
createRegisteredEmptyMovieClip(this, 'mc_d' + i, i + 100, MyBlob, [i, 68, 300, 200, 0x990000]);
this["mc_a" + i].randomChange();
this["mc_a" + i].randomPos();
}
----------------------------