Skip to main content
May 23, 2013
Question

Help: I need to make air.worker to work in my HTML only adobe air

  • May 23, 2013
  • 1 reply
  • 676 views

I need to make air.worker to work in my HTML only adobe air. I see airAliases.js has those definition.

There is no guide or tutorial in how to use them. Can someone direct me example of how to use them?

Also worker do not work in Adobe air.

/*  Main thread

var worker =  air.Worker('assets/js/test.js');

// Setup an event listener that will handle messages received from the worker.

worker.addEventListener('message', function(e) {

  // Log the workers message.

  alert(e.data);

  console.log(e.data);

}, false);

worker.postMessage('Hello World');

*/

/* File: test.js

// Setup an event listener that will handle messages sent to the worker.

self.addEventListener('message', function(e) {

  // Send the message back.

  self.postMessage('You said1: ' + e.data);

}, false);

*/

above code work in ff browser but do not work in adobe air preview mode. It say worker not defined. Is it same as air.worker?

thans

alexk

This topic has been closed for replies.

1 reply

June 4, 2013

anyone

Participating Frequently
June 7, 2013

I have no experiance with workers in AIR, but I think you are assuming that things work like HTML5 web workers, which they do not.  Check out the ActionScript3 dpcs to see how they work:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/Worker.html

Not sure how you can bridge the webkit environment with AS3 workers.  Seems to be unchartered territory.

Best,

Mike