Well ... the whole advantage of using workers is to liberate the main thread
so the UI does not become choppy or stop being responsive
see CrossBridge - Concurrency in Flash Player 11.5
The first SWF that the Flash player runs is known as the primordial Worker; Because it runs on the UI thread in the runtime it has access to the full set of APIs that Flash exposes. Subsequently created workers are all considered children of this primordial worker and have access to most, but not all, of the APIs the primordial worker can use. Because of this it might be necessary for background Workers to communicate with the primordial Worker to get it to perform actions on the child worker's behalf.
APIs with behavioral changes in background Workers
Some of the drawing APIs spawn multiple threads based on the number of CPUs on the host system. Filters, blitting, and rasterizing will create threads to perform these operations. When running in a background worker these threaded operations are turned off.
You should apply the same logic
- use the main thread or primordial worker only to create/display graphics
- delegate heavy tasks to child workers
In itself, creating TextLines and other MovieClips does not slow down the UI
you would not need to delegate those to a child worker
but you could do some BitmapData works (at the pixel level) on a child worker
to not slow down your main UI thread
those are isolated environment, you can pass data serialized as AMF but you would not want (and can't) serialize/deserialize a MovieClip or a Sprite
why? because it is slow?
what is slow exactly?
most of the time you don't need the full serialization of your graphic object,
maybe you can get away with only some of the properties like
see it like if you wanted to save into a
eg. I got a class
MyWindow inheriting from
Sprite and I want save its position
when the app is closing so I can restore the window when the app will reopen
even if you could serialize it you would not want to do that
it would be faster and more efficient to just save: the name of the class, and the
height properties into a custom object, maybe something named
maybe I didn't understood your problem, but to me it make no sense to create MovieClip in child workers to then pass it back to the main worker