SWFAddress CHANGE 事件,调度对象

发布于 2024-09-24 06:17:21 字数 85 浏览 4 评论 0原文

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

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

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

I see something like that in the documentation but I can't find an example online...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

慵挽 2024-10-01 06:17:21

您可以像这样修改 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;
}

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;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文