开发者

SWFAddress CHANGE Event, dispatch Object

开发者 https://www.devze.com 2023-01-16 10:09 出处:网络
Is there a way to dispatch a SWFAdresss CHANGE Event but also pass parameters (an Object) along with it?

Is there a way to dispatch a SWFAdresss CHANGE Event but also pass parameters (an Object) along with it?

I see something li开发者_JAVA百科ke that in the documentation but I can't find an example online...


You could modify the SWFAddressEvent class like so:

 private var _customObject:Object;

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

        _customObject = customObject;
    }

and then when you dispatch the CHANGE event, add the object to the Event:

dispatchEvent(SWFAddressEvent.CHANGE, customObject);

To make the Object publically available:

public function get publicCustomObject():Object
{
    return _customObject;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消