Показать сообщение отдельно
Старый 16.02.2012, 14:40
gloomyBrain вне форума Посмотреть профиль Отправить личное сообщение для gloomyBrain Найти все сообщения от gloomyBrain
  № 10  
Ответить с цитированием
gloomyBrain
 
Аватар для gloomyBrain

блогер
Регистрация: Mar 2008
Адрес: РФ, Санкт-Петербург
Сообщений: 2,272
Записей в блоге: 5
Отправить сообщение для gloomyBrain с помощью ICQ Отправить сообщение для gloomyBrain с помощью Skype™
Можно switch-case реализовать побыстрее (правда, к теме это уже мало относится):

Код AS3:
const _buttonOne:SimpleButton = new SimpleButton();
const _buttonTwo:SimpleButton = new SimpleButton();
const _handlers:Dictionary = new Dictionary();
 
super.addChild(this._buttonOne);
super.addChild(this._buttonTwo);
 
_handlers[this._buttonOne] = this.handler_buttonOne;
_handlers[this._buttonTwo] = this.handler_buttonTwo;
 
super.addEventListener(MouseEvent.CLICK, this.handler_click);
 
function handler_click(event:Event):void {
    if (event.target in this._handlers) (this._handlers[event.target] as Function).call(null);
}
__________________
...вселенская грусть