Показать сообщение отдельно
Старый 19.04.2008, 13:47
terbooter вне форума Посмотреть профиль Отправить личное сообщение для terbooter Найти все сообщения от terbooter
  № 1  
Ответить с цитированием
terbooter

Регистрация: Oct 2006
Адрес: Novosibirsk-Kaliningrad
Сообщений: 1,278
Отправить сообщение для terbooter с помощью ICQ Отправить сообщение для terbooter с помощью Skype™
По умолчанию AsBroadcaster. Как сгенерить кастомное событие в классе?

На АС2 не писал уже давно. Не понимаю как сделать, чтобы мувик генерил события
На код:

Код:
import mx.utils.Delegate;
import AsBroadcaster;


class Slot extends MovieClip {
    
    private var intervalId:Number;
    private var currentCount:Number;
    
    public function Slot() {
        
        AsBroadcaster.initialize(this);
        this.currentCount = 1;
        
        this.rotateSlot();
    }
    
    public function rotateSlot():Void {
        this.intervalId = setInterval(Delegate.create(this,myTimer), 25);
    }
    
    private function myTimer():Void {
        
        this.currentCount++;
        if (this.currentCount % 30 == 0) {
            clearInterval(this.intervalId);
            trace(this);
            this.broadcastMessage("onStopRotating");
        }
        updateAfterEvent();
    }
}
Выдает ошибку:
Цитата:
There is no method with the name "broadcastMessage";