Packageflash.system
Classpublic final class Worker
InheritanceWorker Inheritance Object

A user program-initiated, software-isolated, virtual player instance. There can be multiple ActionScript programs running in the same OS process. In earlier versions, this only happened when a user opened several browser tabs and a separate Flash script/application was to appear in each of these. Now ActionScript code can start new player instances programmatically, using this class. We call these "workers". The primordial ActionScript program that is running when the player starts up is also regarded as a worker. It is called the "main" Worker. The others are called "background" workers. The APIs available to background workers may be somewhat limited. Furthermore physical screen access may not be available to background workers. Off-screen rendering applies then instead. TODO: explain what happens in AVM shell? Do we document AVM shell in public APIs at all?



Public Properties
 PropertyDefined By
  current : Worker
[static] [read-only] Obtain a reference to the worker in which this code is currently running.
Worker
  isPrimordial : Boolean
[read-only]
Worker
  state : String
[read-only]
Worker
Public Methods
 MethodDefined By
  
Worker
 Inherited
_init():*
[static]
_init
  
Worker
 Inherited
AS3
 Inherited
init():*
[static]
init
  
Worker
 Inherited
AS3
  
pr(s:String):void
[static] Temporary - debugging only
Worker
 Inherited
AS3
  
setSharedProperty(key:String, value:*):void
Worker
  
start():void
Run the code blobs passed into the constructor in order and enter the event loop.
Worker
  
Terminate this worker.
Worker
Protected Methods
 MethodDefined By
 Inherited
[static]
protected
 Inherited
_setPropertyIsEnumerable(o:*, V:String, enumerable:Boolean):void
[static]
protected
Public Constants
 ConstantDefined By
 Inheritedlength : int = 1
[static]
length
Property Detail
currentproperty
current:Worker  [read-only]

Obtain a reference to the worker in which this code is currently running.


Implementation
    public static function get current():Worker
isPrimordialproperty 
isPrimordial:Boolean  [read-only]


Implementation
    public function get isPrimordial():Boolean
stateproperty 
state:String  [read-only]


Implementation
    public function get state():String
Constructor Detail
Worker()Constructor
public function Worker()

Method Detail
getSharedProperty()method
public function getSharedProperty(key:String):*

Parameters

key:String

Returns
*
isParentOf()method 
public function isParentOf(other:Worker):Boolean

Parameters

other:Worker

Returns
Boolean
pr()method 
public static function pr(s:String):void

Temporary - debugging only

Parameters

s:String

setSharedProperty()method 
public function setSharedProperty(key:String, value:*):void

Parameters

key:String
 
value:*

start()method 
public function start():void

Run the code blobs passed into the constructor in order and enter the event loop.

terminate()method 
public function terminate():Boolean

Terminate this worker. If this is the main worker, then all other workers are terminated, too. Currently blocks for termination, which should be prompt.

Returns
Boolean — true if the worker was running and interrupted, false if it had already terminated.