flash.system

# SystemUpdater - AS3

Package | flash.system
Class | public class SystemUpdater
Inheritance | SystemUpdater EventDispatcher 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

flash.system.SystemUpdaterType

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | SystemUpdater() Constructor. | SystemUpdater
|  | 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
|  | cancel():void Cancels an active update. | SystemUpdater
|  | dispatchEvent(event:Event):Boolean Dispatches an event into the event flow. | EventDispatcher
|  | hasEventListener(type:String):Boolean Checks whether the EventDispatcher object has any listeners registered for a specific type of event. | EventDispatcher
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void Removes a listener from the EventDispatcher object. | EventDispatcher
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | update(type:String):void Begins an update of a given type. | SystemUpdater
|  | valueOf():Object Returns the primitive value of the specified object. | Object
|  | willTrigger(type:String):Boolean Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type. | EventDispatcher

Events
Click for more information on events
Hide Inherited Events
Show Inherited Events

| Event | Summary | Defined By
--- | --- | --- | ---
|  | activate | [broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. | EventDispatcher
|  | cancel | Dispatched when an update of the player itself is cancelled by the user. | SystemUpdater
|  | complete | Dispatched when the update completes. | SystemUpdater
|  | deactivate | [broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. | EventDispatcher
|  | ioError | Dispatched when an I/O error occurs. | SystemUpdater
|  | open | Dispatched when an update begins. | SystemUpdater
|  | progress | Dispatched to indicate download progress. | SystemUpdater
|  | securityError | Dispatched upon encountering a security error. | SystemUpdater
|  | status | 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

flash.system.SystemUpdaterType
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:

Property | Value
--- | ---
`bubbles` | `false`
`cancelable` | `false`; there is no default behavior to cancel.
`currentTarget` | The object that is actively processing the Event object with an event listener.
`target` | A 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:

Property | Value
--- | ---
`bubbles` | `false`
`cancelable` | `false`; there is no default behavior to cancel.
`currentTarget` | The object that is actively processing the Event object with an event listener.
`target` | The 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:

Property | Value
--- | ---
`bubbles` | `false`
`cancelable` | `false`; there is no default behavior to cancel.
`currentTarget` | The object that is actively processing the Event object with an event listener.
`errorID` | A reference number associated with the specific error (AIR only).
`target` | The network object experiencing the input/output error.
`text` | Text 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:

Property | Value
--- | ---
`bubbles` | `false`
`cancelable` | `false`; there is no default behavior to cancel.
`currentTarget` | The object that is actively processing the Event object with an event listener.
`target` | The 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:

Property | Value
--- | ---
`bubbles` | `false`
`bytesLoaded` | The number of items or bytes loaded at the time the listener processes the event.
`bytesTotal` | The total number of items or bytes that ultimately will be loaded if the loading process succeeds.
`cancelable` | `false`; there is no default behavior to cancel.
`currentTarget` | The object that is actively processing the Event object with an event listener.
`target` | The 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:

Property | Value
--- | ---
`bubbles` | `false`
`cancelable` | `false`; there is no default behavior to cancel.
`currentTarget` | The object that is actively processing the Event object with an event listener.
`target` | The network object reporting the security error.
`text` | Text 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:

Property | Value
--- | ---
`bubbles` | `false`
`cancelable` | `false`; there is no default behavior to cancel.
`code` | A description of the object's status.
`currentTarget` | The object that is actively processing the Event object with an event listener.
`level` | The category of the message, such as `"status"`, `"warning"` or `"error"`.
`target` | The object reporting its status.

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00