从 SequenceWaiter 获取事件对象

发布于 2024-10-12 23:47:38 字数 501 浏览 6 评论 0原文

当我将 SequenceWaiter 步骤添加到 SequenceRunner 中时,如何获取传递到事件中的事件对象?我的测试函数中有代码:

var sequence: SequenceRunner = new SequenceRunner(this);
sequence.addStep(new SequenceCaller(manager, function(): void {
    manager.startUpload();
}));
sequence.addStep(new SequenceWaiter(manager, PackageUploadEvent.BEFORE_PACKAGE_UPLOAD, 1000));
sequence.addStep(new SequenceCaller(manager, function(): void {
    // TODO: Get event object from PackageUploadEvent.BEFORE_PACKAGE_UPLOAD event
}));

When I add SequenceWaiter step into the SequenceRunner, how can I get event object which was passed into the event? There is the code from my test function:

var sequence: SequenceRunner = new SequenceRunner(this);
sequence.addStep(new SequenceCaller(manager, function(): void {
    manager.startUpload();
}));
sequence.addStep(new SequenceWaiter(manager, PackageUploadEvent.BEFORE_PACKAGE_UPLOAD, 1000));
sequence.addStep(new SequenceCaller(manager, function(): void {
    // TODO: Get event object from PackageUploadEvent.BEFORE_PACKAGE_UPLOAD event
}));

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

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

发布评论

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

评论(1

深海蓝天 2024-10-19 23:47:38

flexunit 论坛上回答。基本思想是扩展SequenceWaiter类,重写setupListeners函数来设置额外的事件监听器,并将事件对象保存到该监听器的公共字段中。

Answered on flexunit forum. The basic idea is to extend SequenceWaiter class, override setupListeners function to set up additional event listener and save event object to the public field in this listener.

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