Copy link to clipboard
Copied
Hi,
I'm trying to set up a simple example of workers following the Adobe examples but when I try to create an instance of a worker it always returns null.
private var worker:Worker;
var workerLoader:URLLoader = new URLLoader();
workerLoader.dataFormat = URLLoaderDataFormat.BINARY;
workerLoader.addEventListener(Event.COMPLETE, loadComplete);
workerLoader.load(new URLRequest("BackWorker.swf"));
private function loadComplete(event:Event):void {
var workerBytes:ByteArray = event.target.data as ByteArray;
trace(workerBytes.length); //this traces out 154876 so I know my worker swf is being loaded.
worker = WorkerDomain.current.createWorker(workerBytes);
trace(worker); //this traces null
}
Would anyone have any ideas why the worker isn't being instantiated?
Thanks,
Mark
Have something to add?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now