Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript 1.0/2.0 (http://www.flasher.ru/forum/forumdisplay.php?f=93)
-   -   Analog meter (random rotation) (http://www.flasher.ru/forum/showthread.php?t=146977)

q17 23.11.2010 14:49

Analog meter (random rotation)
 
Вложений: 1
Прошу помощи в реализации скрипта, который бы заставил свободно дергаться стрелочку (movie clip), в аналоговом метре.
Many Thanks!

Leonard 24.11.2010 10:14

Код AS1/AS2:

onClipEvent(load){
        x = 0;
}
onClipEvent(enterFrame){
        trace(this._rotation);
        if(x == 0){
        this._rotation += 1 + Math.random()*10;
        if(this._rotation > Math.random()*70){
                trace(x);
                x = 1;
        }
        }
        if(x == 1){
        this._rotation -= 1 + Math.random()*10;
        if(this._rotation < -Math.random()*70){
                trace(x);
                x = 0;
        }
 
}
}



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

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