Форум Flasher.ru
Ближайшие курсы в Школе RealTime
Список интенсивных курсов: [см.]  
  
Специальные предложения: [см.]  
  
 
Блоги Правила Справка Пользователи Календарь Сообщения за день
 

Вернуться   Форум Flasher.ru > Flash > ActionScript 1.0/2.0

Версия для печати  Отправить по электронной почте    « Предыдущая тема | Следующая тема »  
Опции темы Опции просмотра
 
Создать новую тему Ответ
Старый 15.02.2009, 20:06
Sever_a вне форума Посмотреть профиль Отправить личное сообщение для Sever_a Найти все сообщения от Sever_a
  № 1  
Ответить с цитированием
Sever_a

Регистрация: Oct 2008
Сообщений: 15
По умолчанию Вращение линии по окружности средствами 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 
}
}
Почему этот код не работает? ругается на строку
}function drawLine(rot:Number){


Последний раз редактировалось iNils; 15.02.2009 в 20:48.
Старый 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
}
}

Старый 15.02.2009, 23:25
AlexCooper вне форума Посмотреть профиль Отправить личное сообщение для AlexCooper Найти все сообщения от AlexCooper
  № 3  
Ответить с цитированием
AlexCooper
 
Аватар для AlexCooper

Регистрация: Sep 2008
Адрес: Черкассы
Сообщений: 1,167
Записей в блоге: 1
Отправить сообщение для AlexCooper с помощью ICQ Отправить сообщение для AlexCooper с помощью Skype™
2 Sever_a: Пробуйте пользоваться хотя б "Auto Format"ом. Себе дешевле будет, так как 100 строчек такого кода просто - "не хачу читать, многа букв".
__________________
return this...

Создать новую тему Ответ Часовой пояс GMT +4, время: 15:00.
Быстрый переход
  « Предыдущая тема | Следующая тема »  

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.


 


Часовой пояс GMT +4, время: 15:00.


Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.