1
votes

I have downloaded and overlayed the AIR 4 SDK, which supports Workers on Android.

Yet in Flash Builder 4.7, when I try to create a Worker via the menu, I get the error message:

"You must create a Flex or Actionscript project to hold this file"

How to

1) Work around this to get Workers working on Android/Mobile even if not via the menu?

and/or

2) Get Workers working the way they were meant to work in Flash Builder, on Android/Mobile?

1

1 Answers

0
votes

What do you mean, "create a Worker via the menu"?

Flash Builder 4.7 is getting very old - older than AIR 4. If you use the proper SDK and -swf-version and air namespace 4.0 in your app xml, then you should just be able to import and use the Worker classes in your code, ala:

import flash.system.Worker;
import flash.system.WorkerDomain;

public class Main extends Sprite
{
    private var _worker:Worker;
    ...

I have a compatibility library with some demos that may help you (since it looks up the classes dynamically, you don't need the imports, if that's the problem), and I blogged about Android support when it came out:

https://github.com/jcward/AS3-Worker-Compat

http://jcward.com/AIR+3.9+Workers+Beta

But as you can tell, I'm not a Flash Builder user, so I may not be able to help in that regard. Good luck!