
28-01-2006, 15:47
|
 |
מנהל פורום פלאש
|
|
חבר מתאריך: 04.03.05
הודעות: 5,834
|
|
צריך לולאת FOR כי אתה הולך כל פעם על ה i החדש וצריך לבדוק את כל המוביקליפים מחדש ולכל אחד מהם להוסיף i שכל הזמן עולה והבדיקה הזאת חוזרת כל פעם.
קוד:
var rand:Number = 0
var i:Number = 0
var currentmax:Number = i
onLoad = function(){
_root.attachMovie("hell","hell",999999)
_root.hell._x = 50
_root.hell._y = 125
_root.hell._rotation = 90
}
onEnterFrame = function(){
if(Key.isDown(38)){
_root.hell._rotation-=6
}
if(Key.isDown(40)){
_root.hell._rotation+=6
}
if(Key.isDown(39)){
_root.hell._x+=5*Math.sin((Math.PI/180)*_root.hell._rotation)
_root.hell._y-=5*Math.cos((Math.PI/180)*_root.hell._rotation)
}
for (i = 0; i <= currentmax; i++) {
_root["wa"+i]._x-=5
}
}
function addWalls(){
i++
rand = random(3)
_root.attachMovie("w"+rand,"wa"+i,i*5)
_root["wa"+i]._x = 551.0
_root["wa"+i]._y = 0.0
currentmax = i
}
setInterval(addWalls,3000)
|