Packageflash.system
Classpublic final class Shell
InheritanceShell Inheritance EventDispatcher Inheritance Object

The Shell class allows an application to interact with the operating system shell (for example, the Windows Explorer or the Mac OS X Finder).

The shell is a singleton object, created automatically at application startup. Get the shell instance with the static property, Shell.shell.



Public Properties
 PropertyDefined by
  autoExit : Boolean
Specifies whether the application should automatically terminate when all windows have been closed.
Shell
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  id : String
[read-only] The application ID of this application.
Shell
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  shell : Shell
[static][read-only] Obtains the singleton instance of the Shell class.
Shell
Public Methods
 MethodDefined by
  
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Register an event listener.
Shell
  
Dispatch an event.
Shell
  
exit():void
Terminates this application.
Shell
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
 Inherited
setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of the specified object.
Object
 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
 EventSummaryDefined by
   Dispatched when this application becomes active.Shell
 Inherited Dispatched when Flash Player gains operating system focus and becomes active.EventDispatcher
   Dispatched when this application becomes inactive.Shell
 Inherited Dispatched when Flash Player loses operating system focus and is becoming inactive.EventDispatcher
   Dispatched when an application is invoked.Shell
   Dispatched when either a new network connection becomes available or an existing network connection is lost.Shell
Property detail
autoExitproperty
autoExit:Boolean  [read-write]

Specifies whether the application should automatically terminate when all windows have been closed. By default, its value is true.

Implementation
    public function get autoExit():Boolean
    public function set autoExit(value:Boolean):void
idproperty 
id:String  [read-only]

The application ID of this application. The value of this ID is set in the application descriptor file (application.xml).

Implementation
    public function get id():String
shellproperty 
shell:Shell  [read-only]

Obtains the singleton instance of the Shell class.

Implementation
    public static function get shell():Shell
Method detail
addEventListener()method
public override function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void

Register an event listener.

Parameters
type:String
 
listener:Function
 
useCapture:Boolean (default = false)
 
priority:int (default = 0)
 
useWeakReference:Boolean (default = false)
dispatchEvent()method 
public override function dispatchEvent(event:Event):Boolean

Dispatch an event.

Parameters
event:Event

Returns
Boolean
exit()method 
public function exit():void

Terminates this application.

The call to exit will return; the shutdown sequence does not begin until the currently executing code (i.e., the current event handler) has completed.

Note that closing and close events will not be not dispatched by application windows. If windows should be notified before your application exits, you can dispatch closing events for each open window. If a window close event is required by application logic, call the window close method before exiting.

Event detail
activateevent 
Event object type: flash.events.Event
Event.type property = flash.events.Event.ACTIVATE

Dispatched when this application becomes active.

Note: In this Alpha release of Apollo, the activate event is only dispatched when the automatically created, initial window of the application becomes active.

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

Note: This event does not go through a "capture phase" and is dispatched directly to the target, whether the target is on the display list or not.

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.
targetAny DisplayObject instance with a listener registered for the ACTIVATE event.
deactivateevent  
Event object type: flash.events.Event
Event.type property = flash.events.Event.DEACTIVATE

Dispatched when this application becomes inactive.

Note: In this Alpha release of Apollo, the deactivate event is only dispatched when the automatically created, initial window of the application becomes inactive.

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

Note: This event does not go through a "capture phase" and is dispatched directly to the target, whether the target is on the display list or not.

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.
targetAny DisplayObject instance with a listener registered for the DEACTIVATE event.
invokeevent  
Event object type: flash.events.InvokeEvent
InvokeEvent.type property = flash.events.InvokeEvent.INVOKE

Dispatched when an application is invoked. InvokeEvents are queued until a listener is registered. When an application is invoked a second time, another instance of the application is not started. Instead, the first instance receives an additional invocation event. It is the responsibility of the application to handle subsequent invocation events appropriately.

flash.events.InvokeEvent.INVOKE defines the value of the type property of an InvokeEvent event object.

The InvokeEvent object has the following properties:

PropertiesValues
argumentsthe array of string arguments passed during this invocation.
currentDirectorya File object representing the directory that should be used to resolve any relative paths in the arguments array.
bubblesNo.
cancelablefalse; There is no default behavior to cancel.
currentTargetIndicates the object that is actively processing this InvokeEvent object with an event listener.
targetAlways the Shell object.
networkChangeevent  
Event object type: flash.events.Event
Event.type property = flash.events.Event.NETWORK_CHANGE

Dispatched when either a new network connection becomes available or an existing network connection is lost.

A network change event does not necessarily mean that the host computer has gone online or offline; it may just be transitioning from one type of connection to another. Applications can use this event to help optimize the task of monitoring remote resource availability. The dispatch of a network change event is a good time to check any remote resources. Note that there may be a short delay between a network change and the delivery of this event.

Defines the value of the type property of a networkChange 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 Shell object.




 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/apollo/1.0/aslr/flash/system/Shell.html