deedjy
Messages postés14Date d'inscriptionlundi 5 juillet 2004StatutMembreDernière intervention 2 avril 2009
-
11 août 2005 à 15:22
deedjy
Messages postés14Date d'inscriptionlundi 5 juillet 2004StatutMembreDernière intervention 2 avril 2009
-
15 août 2005 à 18:09
Bonjour, je fais bouger un clib que je nomme A avec de l'actionscript. ensuite je le duplique... jusquela tout va bien... mais mon soucie est que le tout ce trouve sous un masque et la c'est le bordel... j'anime 24 clib A.. conséquence: 1 clip sous le masque et tout les autre au dessus... je sais que c'est une question de profondeur mais j'ai rien trouver qui puisse me mettre sur la voie.....
voici mon code:
-- Dans le clib A (pour la mouvement):
onClipEvent (load) {
//data you may want to change
width = 768;
height = 75;
speed = Math.round(Math.random()*2)+1;
//initial positions
x = this._x=Math.random()*width;
y = this._y=Math.random()*height;
alpha = this._alpha=Math.random()*height
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;
}
}
-- Maintenant sur l'image1 calque "sous masque":
i = 0;
while (i<25) {
//duplicateMovieClip(dot, "dot"+i, i);
a.duplicateMovieClip("a"+i, i);
i++;
}