When code is executing within the context of a non-primordial worker (i.e. the background), some flashruntime API behavior will be different from that of Actionscript code that executes in the main thread. The following APIs will behave differently when used from within a background worker.
Non-functional APIs
The following APIs will not be available from within a background worker. Any attempt to construct an instance of any of these will throw an IllegalOperationError with the message "This feature is not available within this context," the errorID will be the same in all instances, allowing developers to key off of this value.
- flash.desktop.Clipboard // calling constructor will throw; calling generalClipboard will return null
- flash.desktop.NativeDragManager // isSupported returns false
- flash.desktop.Updater // isSupported returns false
- flash.display.NativeMenu // isSupported returns false
- flash.display.NativeWindow // isSupported returns false
- flash.display.ToastWindow // can't access instance because stage.window will never be defined
- flash.display.Window // can't access instance because stage.window will never be defined
- flash.external.ExtensionContext // createExtensionContext() will always return null or throw an error
- flash.external.ExternalInterface // available returns false
- flash.html.* // HTMLLoader.isSupported returns false
- flash.media.CameraRoll // supportsAddBitmapData and supportsBrowseForImage returns false
- flash.media.CameraUI // isSupported returns false
- flash.media.StageWebView // isSupported returns false
- flash.net.drm.* // DRMManager.isSupported returns false
- flash.printing.* // PrintJob.isSupported returns false
- flash.security.XMLSignatureValidator // isSupported returns false
- flash.system.IME // isSupported returns false
- flash.system.SystemUpdater // calling constructor throws
- flash.text.StageText // calling constructor throws
- flash.ui.ContextMenu // isSupported returns false
- flash.ui.GameInput // isSupported returns false
- flash.ui.Mouse // all methods are no-ops; setting 'cursor' property is a no-op
Behavioral changes to APIs
The following APIs have modified behavior when running from within a background worker. Some calls on methods are no-ops, while others will throw an IllegalOperationError or equivalent as is consistent with the documented API. Return values should be consistent with the documentation to the extent possible. For example, if a method returns an Array with elements in it under normal conditions, when executing from within a background worker, it will return an empty Array.
- flash.accessibility.Accessibilty
- active // always returns false
- updateProperties(); // no-op
- flash.desktop.NativeApplication** properties
·
- flash.display.Stage
- allowsFullScreen // always returns false
- stage3Ds // always returns empty Vector
- stageVideos // always returns empty Vector
- supportsOrientationChange // always returns false
- wmodeGPU // always returns false
- flash.filesystem.File
- browseForDirectory(), browseForOpen(), browseForOpenMultiple(), browseForSave() // no-op
- flash.net.FileReference** browse(), download(), save() // no-op; always returns false
- flash.net.FileReferenceList** browse() // no-op; always returns false
- flash.system.System
- ime // always returns null
- exit() // forces this background worker to stop and shutdown
- setClipboard() // no-op
-
- methods
- activate(), clear(), copy(), cut(), paste(), selectAll() // no-op
- exit() // forces this background worker to stop and shutdown
- events
- only exiting event is supported – this event will get dispatched when the worker is shutting down (happens either with life cycle method calls or “main” worker is shutting down, i.e. runtime is exiting; not cancelable from background worker)
-
- supportsDefaultApplication, supportsDockIcon, supportsMenu, supportsStartAtLogin, supportsSystemTrayIcon // all return false
- activeWindow // returns null
- autoExit // setter is a no-op
- idleThreshold // setter is a no-op
- openedWindows // returns an empty Array []
- systemIdleMode // setter is no-op
Increased GPU Reach - Constrained Stage3D profile
A new parameter to Context3D has been introduced called "profile". This parameter is supplied to the Stage3D.requestContext3D() function and you can give it one of two value Context3DProfile.BASELINE ("baseline") which will return the typical Context3D that has existed in previous releases, or Context3DProfile.BASELINE_CONSTRAINED ("baselineConstrained") which will return a new kind of Context3D capable of running with hardware acceleration on previously unsupported GPU's. Constrained profile enables content authors to create Stage3D content targeting older systems using graphics cards such as Intel® GMA 900/950 on Windows® . The trade-off for targeting lower end hardware with Constrained profile is that the Stage3D capabilities will be limited in order to guarantee that content runs well with that hardware. Cards such as the GMA 900/950 only support pixel/vertex shader version 2.0 which forces the following limits on Stage3D when in Constrained profile:
- Limited to 64 ALU and 32 texture instructions per shader.
- Only 4 texture read indirections per shader.
- Limited to a smaller amount of constants/varying/temps per shader.
- No support for predicate register. This affects sln/sge/seq/sne and needs to be replaced with compound mov/cmp instructions which are available with ps_2_0 (this will be done under the hood at the cost of using more instruction slots compared to ps_2_x).
- The Context3D back buffer must always be within the bounds of the stage.
- Only one instance of a Context3D running in Constrained profile is allowed within a Flash Player instance.
- As with mobile the classic Flash Display List elements will not be updated while constrained Stage3D content is visible unless Context3D.present() is called.
'Profile' is the second optional parameter of the requestContext3D method. Developers can request profile "baselineConstained" to get a Context3D in constrained mode, as the api below shows: function requestContext3D ( context3DRenderMode : String = "auto", profile : String = "baseline" ) : void;
Example:
stage.stage3Ds[0].addEventListener(Event.CONTEXT3D_CREATE, createdHandler);
stage.stage3Ds[0].requestContext3D(Context3DRenderMode.AUTO, Context3DProfile.BASELINE_CONSTRAINED);
Direct AIR deployment using ADT
Installation:
To install an IPA on a device, use the following command:
adt -installApp -platform ios -device <deviceID> -package <ipa-file>
Uninstall:
To uninstall an IPA from a device, use the following command:
adt -uninstallApp -platform ios -device <deviceID> -appid <app-id>
<deviceID> of your connected device would be the ‘Handle’ value listed by the following command:
@SDKLocation/bin/adt –devices –platform ios
<app-id> is specified in the application descriptor file (app.xml) within the <id> tag . If you create your project using Flash Builder , by default, it would be the same as your app name.
If only one device is connected to the desktop, omit the '-device <deviceID> ' argument and the application will be installed/uninstalled on the connected device.
adt -installApp -platform ios -package <ipa-file>
iOS Push Notifications
1) The app identifier (id tag) in the app-xml should be same as the application identifier of the mobile provisioning certificate enabled with Push notifications.
2) Include the aps-environment entitlement in your app descriptor: