0

有没有办法调度一个 SWFAdresss CHANGE 事件,但同时也传递参数(一个对象)?

我在文档中看到类似的内容,但我在网上找不到示例...

4

1 回答 1

0

您可以像这样修改 SWFAddressEvent 类:

 private var _customObject:Object;

public function SWFAddressEvent(type:String, customObject:Object, bubbles:Boolean = false,  cancelable:Boolean = false) {
        super(type, bubbles, cancelable);

        _customObject = customObject;
    }

然后当您调度 CHANGE 事件时,将对象添加到事件中:

dispatchEvent(SWFAddressEvent.CHANGE, customObject);

要使对象公开可用:

public function get publicCustomObject():Object
{
    return _customObject;
}
于 2010-09-20T06:05:24.623 回答