Показать сообщение отдельно
Старый 15.02.2009, 20:26
Fatality вне форума Посмотреть профиль Отправить личное сообщение для Fatality Найти все сообщения от Fatality
  № 2  
Ответить с цитированием
Fatality
 
Аватар для Fatality

Регистрация: Jan 2009
Адрес: Одесса
Сообщений: 309
Отправить сообщение для Fatality с помощью ICQ
Объявляйте функцию на новой строке.
Код AS1/AS2:
rotate=0;//this variable will rotate the lines
number=0;//this variable will give a limit to the number of lines
this.onEnterFrame=function(){
rotate++;//I increment the rotation angle
drawLine(rotate);//I call the drawLine function each frame with the rotate variable as parameter
}
function drawLine(rot:Number){
number++;//I increment the line count
if(number>180){number=0}//I don't want more than 180 lines on the screen
this.createEmptyMovieClip("line"+number, number);//create lines
this["line"+number].lineStyle(4,0x00FF00,100);
this["line"+number].moveTo(0,0);
this["line"+number].lineTo(200,0);
this["line"+number]._x=Stage.width/2;//position lines
this["line"+number]._y=Stage.height/2;//position lines
this["line"+number]._rotation+=rot;//rotate lines
this["line"+number].onEnterFrame=function(){
this._alpha-=0.5;//fade lines
}
}