[flash=images/flash-file/les49.swf WIDTH=625 HEIGHT=400 ][/flash]
الكود الأول :numstars = 100;
speed = 5;
a_field = new Array(numstars);
function a(x, y, speed) {
this.x = x;
this.y = y;
this.speed = speed;
}
for (i=0; i a_field[i] = new a(random(550), random(400), random(speed)+1);
duplicateMovieClip("a", "a_" add i, i+10);
}
الكود الثاني :speed = 5;
a_field = new Array(numstars);
function a(x, y, speed) {
this.x = x;
this.y = y;
this.speed = speed;
}
for (i=0; i a_field[i] = new a(random(550), random(400), random(speed)+1);
duplicateMovieClip("a", "a_" add i, i+10);
}
for (i=0; i a_field[i].x += a_field[i].speed;
if (a_field[i].x>550) {
a_field[i].x = 0;
}
setProperty("a_" add i, _x, a_field[i].x);
setProperty("a_" add i, _y, a_field[i].y);
setProperty("a_" add i, _alpha, a_field[i].speed*40);
}
الكود الثالث :if (a_field[i].x>550) {
a_field[i].x = 0;
}
setProperty("a_" add i, _x, a_field[i].x);
setProperty("a_" add i, _y, a_field[i].y);
setProperty("a_" add i, _alpha, a_field[i].speed*40);
}
gotoAndPlay (2);
لحفظ الدرس اضغط كلك يمين واختر حفظ الهدف بإسم