I recently found myself needing to load two external files during the setup phase of a test. Normally I'd use Async.proceedOnEvent() with something like:
[BeforeClass(async)]
publicstaticfunction setUpBeforeClass():void
{
_oneRecord = new URLLoader(new URLRequest("data/OneRecord.csv"));
Async.proceedOnEvent(ZeoCSVParserTest, _oneRecord, Event.COMPLETE);
// Trying to load the second file causes problems
// _complexRecord = new URLLoader(new URLRequest("data/ComplexRecord.csv"));
// Async.proceedOnEvent(ZeoCSVParserTest, _complexRecord, Event.COMPLETE);
}
In this case adding a second Async.proceedOnEvent() doesn't work. I ended up creating an event aggregator class to handle waiting for the needed events. I was curious if there was a facility already built in that would handle this?