Форум 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)
-   -   Вращающееся меню. Как его затормозить? (http://www.flasher.ru/forum/showthread.php?t=114253)

VFX 23.07.2008 14:08

Вращающееся меню. Как его затормозить?
 
Здравствуйте, я недавно начал изучать флэш, нашёл исходник меню, но у него есть 1 недостаток, при запуске, если мышь находится далеко от центра, то меню начинает быстро вращаться. Как можно его затормозить?
И ещё, при кликании на значках, ссылка открывается в новом окне, можно ли сделать, чтоб чтоб ссылкка открывалась в том же окне? Спасибо.

Код:

var _buttonQuantity: Number = 8;
var _widthParabola: Number = 200;
var _heightParabola: Number = 36;
var _positionParabolaButtonsX: Number = 260;
var _positionParabolaButtonsY: Number = 105;
var _reductionScale: Number = 2.4;
var _speedRotations: Number = 1*70;
var _oneRadian: Number = Math.PI/180;
var _degreeParabola: Number = 0;
var _controllTypeScale: Boolean = true;
var _addressesSites: Array = ["http://games.nadym.ru/web/viewpage.php?page_id=3", "http://games.nadym.ru/web/viewpage.php?page_id=4", "http://games.nadym.ru/web/viewpage.php?page_id=2", "http://games.nadym.ru/web/viewpage.php?page_id=6", "http://games.nadym.ru/web/viewpage.php?page_id=7", "http://games.nadym.ru/web/viewpage.php?page_id=5", "http://games.nadym.ru/f/","http://il2.nadym.ru/forum/index.php?"];
var _degreeParabolaOneRadian: Number = _degreeParabola*_oneRadian;
var _buttonSectorParabola: Number = 360/_buttonQuantity;
var _viewPerspectiveScale: Number = 100/_heightParabola;
/*——————————————————————————————————————————————————————————————————————
——————————————————————————————————————————————————————————————————————*/
for (var i:Number = 0; i<_buttonQuantity; i++)
{
        var iconButton:MovieClip = attachMovie("Icon"+i, "iconButton"+i, this.getNextHighestDepth());
        iconButton._positionParabola = i*(_buttonSectorParabola);
        iconButton._thisAddressSite = i;


    iconButton.onEnterFrame = function()
        {
                if (_xmouse<_positionParabolaButtonsX)
                {
                        this._positionParabola -= (_positionParabolaButtonsX-_xmouse)/_speedRotations;
                }
                else if (_xmouse>_positionParabolaButtonsX)
                {
                        this._positionParabola -= (_positionParabolaButtonsX-_xmouse)/_speedRotations;
                }
                   
                var _thisParabolaX = _widthParabola*Math.cos(this._positionParabola*_oneRadian);
                var _thisParabolaY = _heightParabola*Math.sin(this._positionParabola*_oneRadian);
                this._x = _positionParabolaButtonsX+_thisParabolaX*Math.cos(_degreeParabolaOneRadian)-_thisParabolaY*Math.sin(_degreeParabolaOneRadian);
                this._y = _positionParabolaButtonsY+_thisParabolaX*Math.sin(_degreeParabolaOneRadian)+_thisParabolaY*Math.cos(_degreeParabolaOneRadian);
               
                if(_controllTypeScale)
                {
                        this._xscale = this._yscale = Math.floor(((_positionParabolaButtonsY-this._y)-(_heightParabola*_reductionScale))*-1);
                }
                else
                {
                    this._xscale = Math.floor(_thisParabolaY*_viewPerspectiveScale);
                }
               
                this.swapDepths(Math.floor(this._y*10));
        };
       
       
        iconButton.onPress = function()
        {
                getURL(_addressesSites[this._thisAddressSite], "_blank");
        };
}


VFX 23.07.2008 22:04

Честно пытался поправить, но не получилось. В итоге я решил что лучшим вариантом будет разместить на отдельном слое пустой клип (размером с менюшку), который будет при RollOut запускать цикл в котором переменная _speedRotations будет постепенно уменьшаться с текущего значения до (примерно) 260. вот примерно такая мысль... только как это сделать понятия не имею, помогите кто чем может. :)


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

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