Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript 3.0 (http://www.flasher.ru/forum/forumdisplay.php?f=83)
-   -   flash часы для сайта, с 4-мя часовыми поясами (http://www.flasher.ru/forum/showthread.php?t=144265)

slavaklimov 07.09.2010 20:03

flash часы для сайта, с 4-мя часовыми поясами
 
Добрый день всем, помогите разобраться с кодом.

Есть код экшена (ActionScript 3.0) - часов с 4-мя часовыми поясами.
Сделал всё так как написано в статье было (http://naublog.ru/2010/06/analogovye...tionscript3-0/), но к сожалению скрипт так и не работает…
Не могу понять в чем дело!.. Так как сам только начал недавно изучать Flash.
Могли бы вы подробнее описать как правильно создать такие часики или в чём там ошыбка.
Очень важный вопрос для меня. Заранее благодаерн за ответ.

Вот код самого скрипта:
Код:

stage.addEventListener(Event.ENTER_FRAME, enterFrame);
 
function enterFrame(e:Event):void {
        var currentDate:Date = new Date();
        var currentMonth = currentDate.month; // 0-11
        var currentDay = currentDate.day; //0-6 (0-Sunday)
        var currentD = currentDate.date; //1-31
 
        var sec:Number = currentDate.getUTCSeconds();
        var min:Number = currentDate.getUTCMinutes();
        var hour:Number = currentDate.getUTCHours();
 
        if( (currentMonth==2 && (currentD > 24+currentDay)) || (currentMonth>2 && currentMonth<9) || (currentMonth==9 && (currentD < 24+currentDay)) ){
                //New-York
                //NewSecLine.rotation = 6*sec;
                NewMinLine.rotation = 6*min + sec*0.1;
                NewHLine.rotation = 30*(hour-4) + min/2;
 
                //London
                //SecLine.rotation = 6*sec;
                MinLine.rotation = 6*min + sec*0.1;
                HLine.rotation = 30*(hour+1) + min/2;
 
                //Moscow
                //MosSecLine.rotation = 6*sec;
                MosMinLine.rotation = 6*min + sec*0.1;
                MosHLine.rotation = 30*(hour+4) + min/2;
 
                //Tokio
                //TokSecLine.rotation = 6*sec;
                TokMinLine.rotation = 6*min + sec*0.1;
                TokHLine.rotation = 30*(hour+10) + min/2;
        }else{
        //New-York
        //NewSecLine.rotation = 6*sec;
        NewMinLine.rotation = 6*min + sec*0.1;
        NewHLine.rotation = 30*(hour-5) + min/2;
 
        //London
        //SecLine.rotation = 6*sec;
        MinLine.rotation = 6*min + sec*0.1;
        HLine.rotation = 30*hour + min/2;
 
        //Moscow
        //MosSecLine.rotation = 6*sec;
        MosMinLine.rotation = 6*min + sec*0.1;
        MosHLine.rotation = 30*(hour+3) + min/2;
 
        //Tokio
        //TokSecLine.rotation = 6*sec;
        TokMinLine.rotation = 6*min + sec*0.1;
        TokHLine.rotation = 30*(hour+9) + min/2;       
        }
}


tsarapkabel 08.09.2010 16:22

1) Оформи код в теги AS3 /AS3.

2) Жи, ши пиши с буквой И. :D

3) Поясни на что конкретно ругается или выложи свой исходник.


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

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