从 SequenceWaiter 获取事件对象
当我将 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在flexunit 论坛上回答。基本思想是扩展
SequenceWaiter
类,重写setupListeners
函数来设置额外的事件监听器,并将事件对象保存到该监听器的公共字段中。Answered on flexunit forum. The basic idea is to extend
SequenceWaiter
class, overridesetupListeners
function to set up additional event listener and save event object to the public field in this listener.