2009年4月22日 星期三

006-flash homework 02


fall = 5;
total = 100;

for (i=0; i< total; i++) {
obj = this.attachMovie("mcc", "layer"+i, i);
obj.g = 1+i/total;
obj._x = 800*i/total;
obj._y = 0;
obj.rotation = i;
}

this.onEnterFrame = function() {
for (i=0; i< total; i++) {
obj = this["layer"+i];
obj._alpha = random(100);
obj._y += obj.g*fall;
obj._rotation +=i/10
if (obj._y>=600 || obj._y<=0) {
obj.g *= -1;
}
}
};
----------------------------------------------------
改了一部分的數值就變這樣...


fall = 5;
total = 100;

for (i=0; i< total; i++) {
obj = this.attachMovie("mcc", "layer"+i, i);
obj.g = random(5)+i/total;
obj._x = 800*i/total;
obj._y = 0;
obj.rotation = i;
}

this.onEnterFrame = function() {
for (i=0; i< total; i++) {
obj = this["layer"+i];
obj._alpha = random(60);
obj._y += obj.g*fall;
obj._rotation +=i/10
if (obj._y>=600 || obj._y<=0) {
obj.g *= -1;
}
}
};

沒有留言:

張貼留言