从SequenceWaiter获取事件对象

时间:2011-01-20 11:44:11

标签: flex flexunit

当我将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
}));

1 个答案:

答案 0 :(得分:0)

回答flexunit forum。基本思想是扩展SequenceWaiter类,覆盖setupListeners函数以设置其他事件侦听器并将事件对象保存到此侦听器中的公共字段。