I'm very new to ActionScript Workers, but I would like to know if this is possible.
From what I have read, ActionScript Workers (ASW) are like separate threads that can do more CPU intensive calculations without interrupting the Main thread (which is executing your main SWF file).
The only example I really seen kicking around was the one illustrating animation playing at a consistent rate while an ASW took care of loading or calculating some intensive math formulas.
Is the Sound API available for ActionScriptWorkers?
(Reposted under my proper login)
They certainly can! Check out my recent blog post on exactly this:
http://flexmonkey.blogspot.co.uk/2012/09/multi-threaded-sound-synthesis-in-flex.html#!/2012/09/multi-threaded-sound-synthesis-in-flex.html
After a fair bit of tinkering, I actually generate a byte array in a background worker and then write the data back to the SampleDataEvent's data property in the primordial thread (i.e. the user interface).
I write the data from the worker from the previous SampleDataEvent while the worker generates the data for the next one - so FlashPlayer is actually doing three tasks simultaneously: offering a responsive UI, playing a tone and generating the next tone.
simon
I'm going to venture out onto a cliff and answer YES to this question.
The release notes has a list of "non-functional" API's, I don't see any sound related classes in the list.
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