iOS Concurrency

Our popular desktop and Android feature, AIR Workers, is now making its debut on iOS! We have added support on iOS devices so that you will be able to execute code in the background without interrupting your application’s main code. Your UI will remain responsive, enhancing the user experience.

Your implementation will remain the same between iOS and Android, except for differences in swf loading and passing byte arrays to the worker.

Because dynamically loading a ‘remote‘ SWF that contains ActionScript code will not work in iOS, remote swf's must be passed to workers as stripped swf's.

Embedding SWFs (which have ABC code) using the [Embed] tag will not work on iOS.

Each additional worker is created from a separate swf. To create a new instance of the Worker class, pass a ByteArray with the bytes of the background worker's swf as an argument to the WorkerDomain class's createWorker()method.

Sample code for loading an external SWF file using a loader:



primordial worker( AS Code :

{

var _urlRequest:URLRequest = new URLRequest("BackgroundWorkerSwf.swf");

var _loader:Loader = new Loader();

var _lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);

_loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completeHandler);

_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,errorHandler);

_loader.load(_urlRequest, _lc);

}



private function completeHandler(e:Event):void

{

//TODO : do your stuff after the swf is loaded.

worker = WorkerDomain.current.createWorker(e.target.bytes);

}

As the code is executed while load function of Loader is called we need to put a isPrimordial property check in background worker:

Background worker Swf( AS Code ) :

{

if(!Worker.Current.isPrimordial)

{

//TODO : do your stuff for the worker thread

}

}



Improved Stage3D Error Messages

We've added new Stage3D error codes to provide developers with additional debugging and error information.

This feature is available for both Flash Player and AIR. Swf's compiled with a version less than 30 will throw the old error code messages. Swf's compiled with version 30 and above will throw the new error code messages.

We have also updated the AS3 documentation for various Stage3D APIs to provide more information about the reasons for the errors thrown.

The table below describes the new error codes and messages for the following Action Script APIs:

ActionScript API New Error Message Context3DObject::configureBackBuffer Error #3780: Requested width of backbuffer is not in allowed range %1 to %2. Error #3781: Requested height of backbuffer is not in allowed range %1 to %2. Context3DObject::createRectangleTexture Error #3782: This call requires a Context3D that is created with profile baseline or above. Context3DObject::setRenderToTexture Error #3779: This call requires a Context3D that is created with the standard profile or above.

New insertAt() and removeAt() Vector and Array APIs

With Flash Player and AIR 19, we have introduced two new APIs for element insertion or removal in Vector and Arrays.

Methods added:

insertAt(index:int, element:*):void;

removeAt(index:int):*;

Please use swf-version 30 or greater and namespace 19.0 or greater to access the new APIs.



Added ability to disable browser zoom factor scaling via HTML

In Flash Player 15, we added code to improve the resolution of Stage3D content when the browser's zoom factor (BZF) was changed.

This was extended to the PPAPI and Windows XP/Vista/7 Active X control in Flash Player 18. In Flash Player 19, we're providing the developer the ability to enabled or disabled this functionality.

BZF is turned on by default but can now be turn on/off by setting a new attribute browserzoom to two possible values scale/noscale in HTML EMBEDSWF and OBJECT tag.

The following table describes the use of this new attribute.