Hi all,
I'm really struggling getting a testing structure in place. I need to test a sub-swf which gets loaded into a range of main applications and its methods are then invoked. Therefore, I want to setup a test initially to load in that sub-swf (before calling its functions).
However, despite Firebug revealing that the swf in question was called ok (200 return) the timeout function always eventually is invoked.
Please can someone tell me what I'm doing wrong as I've been struggling with this for over a week.
Code roughly copy-and-pasted (no errors when I run the original)...
public class loadSWFTester
{
import flash.display.Loader;
import flash.display.LoaderInfo;
import flash.events.*;
import org.flexunit.asserts.*;
import org.flexunit.async.Async;
private var _loader:Loader;
private var _request:URLRequest;
[Before(async)]
public function setUp():void
{
_loader = new Loader();
_request = new URLRequest("http://example.com/my.swf");
[Test(async, description="Swf load example")]
public function loadSwf():void
{
_loader.addEventListener(Event.COMPLETE, Async.asyncHandler(this, verifySwfLoad, 10000, null, handleTimeout));
_loader.load(_request);
}
private function verifySwfLoad(event:Event, passThroughData:Object):void
{
trace("[verifySwfLoad");
}
private function handleTimeout(event:Event):void
{
fail(" testLoad did not execute: "+event);
}
}