ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
flash.system 

SystemUpdater  - AS3

Packageflash.system
Classpublic class SystemUpdater
InheritanceSystemUpdater Inheritance EventDispatcher Inheritance Object

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 10.1

The SystemUpdater class allows you to update modules of the Flash Player, such as the DRM module for Adobe Access, as well as the Flash Player itself. Available modules are listed in the SystemUpdaterType class.

Flash Player identifies the need for a Adobe-Access-module update by dispatching a NetStatusEvent event. The event has a code property with a value of "DRM.UpdateNeeded". For updates to the Adobe Access module, user consent is not required. Listen for the event and initiate the update by calling update("DRM").

Flash Player identifies the need for a player update by dispatching a StatusEvent event, with several possible code property values (see the status event). For updates to the player, user consent is required. Listen for the event and present the user with the option to update. The user must agree to the actual update and initiate the update by, for example, clicking a button in the user interface. You can then initiate the player update directly in ActionScript by calling update("SYSTEM").

Note: The SystemUpdater API is supported on all desktop platforms.

Related API Elements



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
Public Methods
 MethodDefined By
  
Constructor.
SystemUpdater
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
EventDispatcher
  
Cancels an active update.
SystemUpdater
 Inherited
Dispatches an event into the event flow.
EventDispatcher
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
  
Begins an update of a given type.
SystemUpdater
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Events
 Event Summary Defined By
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
  Dispatched when an update of the player itself is cancelled by the user.SystemUpdater
  Dispatched when the update completes.SystemUpdater
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.EventDispatcher
  Dispatched when an I/O error occurs.SystemUpdater
  Dispatched when an update begins.SystemUpdater
  Dispatched to indicate download progress.SystemUpdater
  Dispatched upon encountering a security error.SystemUpdater
  Dispatched when the update fails.SystemUpdater
Constructor Detail

SystemUpdater

()Constructor
public function SystemUpdater()

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 10.1

Constructor.

Method Detail

cancel

()method
public function cancel():void

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 10.1

Cancels an active update.

update

()method 
public function update(type:String):void

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 10.1

Begins an update of a given type. Update types are one of the string constants defined in the SystemUpdaterType class. Only one update is allowed at a time across all browsers.

After the update begins, listen for the events defined in this class. The following events events indicate the end of an update and allow a new update or update attempt to proceed, as does calling the update() function:

  • complete
  • cancel
  • securityError
  • ioError
  • status

Parameters

type:String

Related API Elements

Event Detail

cancel

Event
Event Object Type: flash.events.Event
property Event.type = flash.events.Event.CANCEL

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 10.1

Dispatched when an update of the player itself is cancelled by the user. This event is dispatched only when an update of type SystemUpdaterType.SYSTEM is requested and the user cancels the update.

The Event.CANCEL constant defines the value of the type property of a cancel event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetA reference to the object on which the operation is canceled.

complete

Event  
Event Object Type: flash.events.Event
property Event.type = flash.events.Event.COMPLETE

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 10.1

Dispatched when the update completes.

The Event.COMPLETE constant defines the value of the type property of a complete event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe network object that has completed loading.

ioError

Event  
Event Object Type: flash.events.IOErrorEvent
property IOErrorEvent.type = flash.events.IOErrorEvent.IO_ERROR

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 10.1

Dispatched when an I/O error occurs. For example, one error that can cause this event is a loss of Internet connectivity.

Defines the value of the type property of an ioError event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
errorIDA reference number associated with the specific error (AIR only).
targetThe network object experiencing the input/output error.
textText to be displayed as an error message.

open

Event  
Event Object Type: flash.events.Event
property Event.type = flash.events.Event.OPEN

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 10.1

Dispatched when an update begins. The update is complete when a 'complete' event is sent, or when an IOErrorEvent, SecurityErrorEvent, or StatusEvent is sent.

The Event.OPEN constant defines the value of the type property of an open event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe network object that has opened a connection.

progress

Event  
Event Object Type: flash.events.ProgressEvent
property ProgressEvent.type = flash.events.ProgressEvent.PROGRESS

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 10.1

Dispatched to indicate download progress. This event is like the progress event in the Loader and URLLoader classes.

Defines the value of the type property of a progress event object.

This event has the following properties:

PropertyValue
bubblesfalse
bytesLoadedThe number of items or bytes loaded at the time the listener processes the event.
bytesTotalThe total number of items or bytes that ultimately will be loaded if the loading process succeeds.
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe object reporting progress.

securityError

Event  
Event Object Type: flash.events.SecurityErrorEvent
property SecurityErrorEvent.type = flash.events.SecurityErrorEvent.SECURITY_ERROR

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 10.1

Dispatched upon encountering a security error. For example, a security error that can cause this event is if the player tries to perform an update when an update is not permitted by security policy.

The SecurityErrorEvent.SECURITY_ERROR constant defines the value of the type property of a securityError event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe network object reporting the security error.
textText to be displayed as an error message.

status

Event  
Event Object Type: flash.events.StatusEvent
property StatusEvent.type = flash.events.StatusEvent.STATUS

Language Version: ActionScript 3.0
Runtime Versions: AIR 1.0, Flash Player 10.1

Dispatched when the update fails. An update can fail for one of the following reasons:

  • The caller is running on an unsupported platform or architecture. In this case, the value of the code property is "DRM.UpdateFailedNotSupported" and the value of the level property is "error".
  • The requested update package cannot be located on the server. In this case, the value of the code property is "DRM.UpdateFailedNotCurrentlyAvailable" and the value of the level property is "error".
  • The Adobe Access module is not installed. This error is similar to the "DRM.UpdateNeeded" code, which is dispatched by NetStatusEvent. However, in this case, a more recent version of Flash Player must be downloaded first. In this case, the value of the code property is "DRM.UpdateNeededButIncompatible" and the value of the level property is "error". To perform an update of Flash Player, call SystemUpdater.update(SystemUpdaterType.SYSTEM).
  • The new DRM module could not be downloaded. In this case, the value of the code property is "DRM.UpdateFailed" and the value of the level property is "error".
Defines the value of the type property of a status event object.

This event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
codeA description of the object's status.
currentTargetThe object that is actively processing the Event object with an event listener.
levelThe category of the message, such as "status", "warning" or "error".
targetThe object reporting its status.