2
votes

I want to create an AIR project in Flex. I tried a lot of combinations, but I couldn't get the flash.system.Worker found in Flash Builder. I'm assuming that I'm not using the right Flex/AIR SDK/Namespace declaration combo. I have both Flash Builder 4.6 and 4.7 beta, tried Apache Flex SDK with the 'downloader', downloaded AIR SDK from labs (3.5) and release (3.4) as well (not 100% sure how to install it, but I've overrided it to the current flex sdk folder..) I want to see the Builder recognise the built in Worker class (the code below shouldn't throw error), and use it. I've found samples for Flash Player, but I need it for AIR.

import flash.system.Worker;
...
var w:Worker; 

testproject-app.xml: is the xmlns correct?

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<application xmlns="http://ns.adobe.com/air/application/3.5">

testproject.mxml: is the xmlns correct?

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                   xmlns:s="library://ns.adobe.com/flex/spark" 
                   xmlns:mx="library://ns.adobe.com/flex/mx">
1
Which version of the Flex SDK are you using? Have you updated the AIR SDK to 3.5? By default it ships w/ 3.1 or 3.2 [I forget which]JeffryHouser
"downloaded AIR SDK from labs and release:" it means 3.5 and 3.4csomakk
For sure, you should be using the 4.7 beta. 4.6 does not support the background workers. Both SDKs do support the workers. In your Project Properties, have you set the new SDK as the one you want to use? Installing and using a new AIR SDK is hardly the most user-friendly ordeal in the world, unfortunately. If you have the correct SDK selected, I would revert to Flex SDK 4.6 stock and try the overlay again. I can confirm this works for Mac. Not sure about Windows, though.Josh
thanks.. if you post it as answer, I'll accept it.. going back to Flex 4.6 was the point. thanks again!csomakk
BTW, you should check out AS3-Worker-Compat - it can be compiled by any SDK, creates SWFs that will work in any version of the player, and optionally use Workers if they are available. You didn't mention your target platform, but keep in mind that Workers aren't supported on mobile yet.Jeff Ward

1 Answers

0
votes

also had to set swfversion in compiler params. -swf-version=16