Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript 3.0 (http://www.flasher.ru/forum/forumdisplay.php?f=83)
-   -   Не происходит событие (http://www.flasher.ru/forum/showthread.php?t=154109)

FriOne 12.04.2011 20:44

Не происходит событие
 
Не могу понять, почему не выполняется метод, при событии COMPLETE,
раньше все работало, то ли твинов понавтыкал, то ли еще что..
Вот событие на кнопке по клику:
Код AS3:

public function hideAll(e:Event):void
{
        TweenLite.to(this, 1, {alpha:0, onComplete:this.hiding});
}
public function hiding():void
{
        combo.alpha = 0;
        dataCount.alpha = 0;
        dispatchEvent(new Event(Event.COMPLETE));
}

Здесь его добавляю..
Код AS3:

public function loadCred(e:Event):void
{
        this.removeListeners();
        this.currentMenu = this.credit;
        this.hideButtons();
        TweenLite.to(this.res, 1, {alpha:0, onComplete:cred});
}
public function cred():void
{
        if(!credit){
                this.credit = new Credit();
                this.credit.bdValues = this.bdValues;
                this.credit.create();
                addChild(credit);
        }
        this.credit.addEventListener(Event.COMPLETE, showCredButton); //////тут
        TweenLite.to(this.credit, 1, {alpha:1});
}
public function showCredButton(e:Event):void
{
        this.credit.removeEventListener(Event.COMPLETE, showCredButton);
        swapChildren(this.currentMenu, this.res);
        this.showButtons();
        TweenLite.to(this.res, 1, {alpha:1, onComplete:this.addListeners});
}

По клику все прячется, но дальше не исполняет, подскажите в чем косяк.

ChuwY 12.04.2011 21:33

Если я вас правильно понял, то должно быть как-то так.

здесь был неправильный вариант

FriOne 12.04.2011 21:49

Видимо неправильно, но все равно спасибо за ответ)
Вообщем что-то сделал, теперь все работает.. ))


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

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