esparadrapo
%Europe/Berlin %585 %2005, 15:03
Hoi
Ik ben bezig met een scriptje die voor zorgt dat er bollen naar mijn scherm toekomen.
Dus ze komen van in de de diepte naar mijn scherm toe.
dit is mij gelukt maar als je naar mijn script eens kijkt ziet dat de helft naar ene kant gaat en de andere naar de andere kant.
Ik zou graag hebben dat het een beetje verspreid is.
Kan er iemand mij helpen?
i = 10000;
function setBol() {
this.createEmptyMovieClip("bol", 0);
this.attachMovie("bol", "bol"+i, 100+i*10);
this["bol"+i]._x = random(50);
this["bol"+i]._y = random(50);
this["bol"+i]._width = 0;
this["bol"+i]._height = 0;
//trace(i);
makeBigger(this["bol"+i], i);
i--;
}
function makeBigger(varBol, i) {
varBol.onEnterFrame = function() {
trace(i%2);
if ((i%2) == 0) {
this._x += random(30)+10;
this._y += random(25)-10;
} else {
this._x -= random(30)+10;
this._y -= random(25)-10;
}
this._width += 5;
this._height += 5;
if (varBol._width>50) {
this._alpha -= 10;
if (this._alpha<5) {
delete varBol.onEnterFrame;
removeMovieClip(varBol);
}
}
};
}
_root.control.onEnterFrame = setBol;
een voorbeeld op http://www.actionscript.net/showMovie.php?id=952 ;-)
greetz
Ik ben bezig met een scriptje die voor zorgt dat er bollen naar mijn scherm toekomen.
Dus ze komen van in de de diepte naar mijn scherm toe.
dit is mij gelukt maar als je naar mijn script eens kijkt ziet dat de helft naar ene kant gaat en de andere naar de andere kant.
Ik zou graag hebben dat het een beetje verspreid is.
Kan er iemand mij helpen?
i = 10000;
function setBol() {
this.createEmptyMovieClip("bol", 0);
this.attachMovie("bol", "bol"+i, 100+i*10);
this["bol"+i]._x = random(50);
this["bol"+i]._y = random(50);
this["bol"+i]._width = 0;
this["bol"+i]._height = 0;
//trace(i);
makeBigger(this["bol"+i], i);
i--;
}
function makeBigger(varBol, i) {
varBol.onEnterFrame = function() {
trace(i%2);
if ((i%2) == 0) {
this._x += random(30)+10;
this._y += random(25)-10;
} else {
this._x -= random(30)+10;
this._y -= random(25)-10;
}
this._width += 5;
this._height += 5;
if (varBol._width>50) {
this._alpha -= 10;
if (this._alpha<5) {
delete varBol.onEnterFrame;
removeMovieClip(varBol);
}
}
};
}
_root.control.onEnterFrame = setBol;
een voorbeeld op http://www.actionscript.net/showMovie.php?id=952 ;-)
greetz