Down
%Europe/Berlin %773 %2005, 19:34
Dit is (denk ik) een simpel vraagje voor de meeste van jullie..
Ik vroeg me af hoe je in dit script:
op de actions laag...
//randommotion
i = 0;
while (i<25) {
//duplicateMovieClip(dot, "dot"+i, i);
dot.duplicateMovieClip("dot"+i, i);
i++;
}
op de movieclip...
onClipEvent (load) {
//data you may want to change
width = 700;
height = 500;
speed = Math.round(Math.random()*2)+1;
//initial positions
x = Math.random()*width;
y = Math.random()*height;
this._x = x;
this._y = y;
x_new = Math.random()*width;
y_new = Math.random()*height;
}
onClipEvent (enterFrame) {
//x movement
if (x_new>this._x) {
sign_x = 1;
} else {
sign_x = -1;
}
dx = Math.abs(x_new-this._x);
if ((dx>speed) || (dx<-speed)) {
this._x += sign_x*speed;
} else {
x_new = Math.random()*width;
}
//y movement
if (y_new>this._y) {
sign_y = 1;
} else {
sign_y = -1;
}
dy = Math.abs(y_new-this._y);
if ((dy>speed) || (dy<-speed)) {
this._y += sign_y*speed;
} else {
y_new = Math.random()*height;
}
}
Het aantal kan veranderen zodat er nog maar 1 mc over blijft die over je pagina beweegt (Ik wil er een vlinder van maken)..
op mijn site zie je witte puntjes... dit is bovenstaand script..
Alvast bedankt!
Ik vroeg me af hoe je in dit script:
op de actions laag...
//randommotion
i = 0;
while (i<25) {
//duplicateMovieClip(dot, "dot"+i, i);
dot.duplicateMovieClip("dot"+i, i);
i++;
}
op de movieclip...
onClipEvent (load) {
//data you may want to change
width = 700;
height = 500;
speed = Math.round(Math.random()*2)+1;
//initial positions
x = Math.random()*width;
y = Math.random()*height;
this._x = x;
this._y = y;
x_new = Math.random()*width;
y_new = Math.random()*height;
}
onClipEvent (enterFrame) {
//x movement
if (x_new>this._x) {
sign_x = 1;
} else {
sign_x = -1;
}
dx = Math.abs(x_new-this._x);
if ((dx>speed) || (dx<-speed)) {
this._x += sign_x*speed;
} else {
x_new = Math.random()*width;
}
//y movement
if (y_new>this._y) {
sign_y = 1;
} else {
sign_y = -1;
}
dy = Math.abs(y_new-this._y);
if ((dy>speed) || (dy<-speed)) {
this._y += sign_y*speed;
} else {
y_new = Math.random()*height;
}
}
Het aantal kan veranderen zodat er nog maar 1 mc over blijft die over je pagina beweegt (Ik wil er een vlinder van maken)..
op mijn site zie je witte puntjes... dit is bovenstaand script..
Alvast bedankt!