Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript (http://www.flasher.ru/forum/forumdisplay.php?f=5)
-   -   Выподающий список (http://www.flasher.ru/forum/showthread.php?t=60972)

kazakov_gin 22.07.2004 11:31

Выподающий список
 
Думаю понятно, про что я веду речь.
Код:

Draw = MovieClip.prototype;
Draw.createRect = function(x, y, w, h, _color, _fill) {
        this._x = x;
        this._y = y;
        this.beginFill(_fill, 100);
        this.lineStyle(.1, _color, 100);
        this.lineTo(w, 0);
        this.lineTo(w, h);
        this.lineTo(0, h);
        this.endFill();
};
_root.createEmptyMovieClip("thickness", 26100);
_root.thickness.createRect(279, 352, 38, 38, 0xDDEEFF, 0x445566);
_root.thickness.onPress = function() {
        for (q=0; q<3; q++) {
                _root.old_thick = _root._thick;
                _root.createEmptyMovieClip("btn"+q, 10+q);
                _root["btn"+q].createRect(279, 310-40*q, 38, 38, 0xDDEEFF, 0x445566);
                _root["btn"+q]._thick = q*5;
                _root["btn"+q].onRollOver = function() {
                        _root._thick = this._thick;
                        trace(this._thick);
                };
                _root["btn"+q].onRollOut = function() {
                        _root._thick = _root.old_thick;
                };
        }
};
_root.thickness.onRelease = function() {
        for (w=0; w<3; w++) {
                _root["btn"+w].removeMovieClip();
        }
};
_root.thickness.onReleaseOutside = function() {
        for (w=0; w<3; w++) {
                _root["btn"+w].removeMovieClip();
        }
};

скапировать код в первый кадр. фон желательно поставить чёрный (красивее будет :) ).
Проблема:
Не срабатывают функции onRollOver и onRollOut при нажатой кнопке мыши.
И можно ли как-нибудь последние две функции (onRelease и onReleaseOutside) объединить в одну.
Помогите плз.

fiot 22.07.2004 13:09

нажал, держишь, не отпускаешь - этим перекрываеш все event'ы других ... попробуй исспользовать таймер...

silin 22.07.2004 21:25

вариант
Код:

Draw = MovieClip.prototype;
Draw.createRect = function(x, y, w, h, _color, _fill) {
        this._x = x;
        this._y = y;
        this.beginFill(_fill, 100);
        this.lineStyle(.1, _color, 100);
        this.lineTo(w, 0);
        this.lineTo(w, h);
        this.lineTo(0, h);
        this.endFill();
};
_root.createEmptyMovieClip("thickness", 26100);
_root.thickness.createRect(279, 352, 38, 38, 0xDDEEFF, 0x445566);
_root.thickness.onPress = function() {
        for (q=0; q<3; q++) {
                _root.old_thick = _root._thick;
                _root.createEmptyMovieClip("btn"+q, 10+q);
                _root["btn"+q].createRect(279, 310-40*q, 38, 38, 0xDDEEFF, 0x445566);
                _root["btn"+q]._thick = q*5;
                _root["btn"+q].onMouseMove = function() {
                        with(this){
                                if(hitTest(_parent._xmouse,_parent._ymouse,1)){
                                        _root._thick = _thick;
                                        trace(_thick);
                                }else {
                                        _root._thick = _root.old_thick;
                                }
                        }
                }
        }
};
_root.thickness.onRelease = _root.thickness.onReleaseOutside =function() {
        for (w=0; w<3; w++) {
                _root["btn"+w].removeMovieClip();
        }
};


kazakov_gin 23.07.2004 11:13

Спасибо.


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

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