![]() |
|
||||||||||
|
|||||||
|
|
« Предыдущая тема | Следующая тема » |
| Опции темы | Опции просмотра |
|
![]() |
![]() |
|
|||||
|
Регистрация: Oct 2008
Сообщений: 15
|
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
}
}
}function drawLine(rot:Number){ Последний раз редактировалось iNils; 15.02.2009 в 20:48. |
|
|||||
|
Объявляйте функцию на новой строке.
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 } } |
![]() |
![]() |
Часовой пояс GMT +4, время: 08:56. |
|
|
« Предыдущая тема | Следующая тема » |
|
|