Packageorg.apache.flex.core
Classpublic class Application
InheritanceApplication Inheritance ApplicationBase Inheritance flash.display.Sprite
Implements IStrand, IParent, IEventDispatcher
Subclasses Application, Application, Application

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The Application class is the main class and entry point for a FlexJS application. This Application class is different than the Flex SDK's mx:Application or spark:Application in that it does not contain user interface elements. Those UI elements go in the views (ViewBase). This Application class expects there to be a main model, a controller, and an initial view.

See also

ViewBase


Public Properties
 PropertyDefined By
  beads : Array
The array property that is used to add additional beads to an MXML tag.
Application
  controller : Object
The controller.
Application
  initialView : IApplicationView
The initial view.
Application
  model : Object
The data model (for the initial view).
Application
  MXMLDescriptor : Array
[read-only] An array of data that describes the MXML attributes and tags in an MXML document.
Application
  numElements : int
[read-only] The number of elements in the parent.
Application
  valuesImpl : IValuesImpl
[write-only] The org.apache.flex.core.IValuesImpl that will determine the default values and other values for the application.
Application
Public Methods
 MethodDefined By
  
Constructor.
Application
  
addBead(bead:IBead):void
Add a bead to the strand.
Application
  
addElement(c:Object, dispatchEvent:Boolean = true):void
Add a component to the parent.
Application
  
addElementAt(c:Object, index:int, dispatchEvent:Boolean = true):void
Add a component to the parent.
Application
  
generateMXMLAttributes(data:Array):void
An method called by the compiler's generated code to kick off the setting of MXML attribute values and instantiation of child tags.
Application
  
getBeadByType(classOrInterface:Class):IBead
Find a bead on the strand.
Application
  
getElementAt(index:int):Object
Get a component from the parent.
Application
  
getElementIndex(c:Object):int
Gets the index of this subcomponent.
Application
 Inherited
info():Object
An Object containing information generated by the compiler that is useful at startup time.
ApplicationBase
  
Remove a bead from the strand.
Application
  
removeElement(c:Object, dispatchEvent:Boolean = true):void
Remove a component from the parent.
Application
Protected Methods
 MethodDefined By
  
initialize():void
This method gets called when all preinitialize handlers no longer call preventDefault();
Application
Events
 Event Summary Defined By
  Dispatched at startup after the initial view has been put on the display list.Application
  Dispatched at startup.Application
  Dispatched at startup before the instances get created.Application
  Dispatched at startup after the initial view has been put on the display list.Application
Property Detail
beadsproperty
public var beads:Array

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The array property that is used to add additional beads to an MXML tag. From ActionScript, just call addBead directly.

controllerproperty 
public var controller:Object

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The controller. The controller typically watches the UI for events and updates the model accordingly.

initialViewproperty 
public var initialView:IApplicationView

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The initial view.

This property can be used as the source for data binding.

See also

modelproperty 
public var model:Object

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The data model (for the initial view).

This property can be used as the source for data binding.

MXMLDescriptorproperty 
MXMLDescriptor:Array  [read-only]

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

An array of data that describes the MXML attributes and tags in an MXML document. This data is usually decoded by an MXMLDataInterpreter


Implementation
    public function get MXMLDescriptor():Array

See also

numElementsproperty 
numElements:int  [read-only]

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The number of elements in the parent.


Implementation
    public function get numElements():int
valuesImplproperty 
valuesImpl:IValuesImpl  [write-only]

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The org.apache.flex.core.IValuesImpl that will determine the default values and other values for the application. The most common choice is org.apache.flex.core.SimpleCSSValuesImpl.


Implementation
    public function set valuesImpl(value:IValuesImpl):void

See also

Constructor Detail
Application()Constructor
public function Application()

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Constructor.

Method Detail
addBead()method
public function addBead(bead:IBead):void

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Add a bead to the strand.

Parameters

bead:IBead — The bead to be added.

addElement()method 
public function addElement(c:Object, dispatchEvent:Boolean = true):void

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Add a component to the parent.

Parameters

c:Object — The subcomponent to add.
 
dispatchEvent:Boolean (default = true) — Whether to dispatch an event after adding the child.

addElementAt()method 
public function addElementAt(c:Object, index:int, dispatchEvent:Boolean = true):void

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Add a component to the parent.

Parameters

c:Object — The subcomponent to add.
 
index:int — The index where the subcomponent should be added.
 
dispatchEvent:Boolean (default = true) — Whether to dispatch an event after adding the child.

generateMXMLAttributes()method 
public function generateMXMLAttributes(data:Array):void

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

An method called by the compiler's generated code to kick off the setting of MXML attribute values and instantiation of child tags. The call has to be made in the generated code in order to ensure that the constructors have completed first.

Parameters

data:Array — The encoded data representing the MXML attributes.

See also

getBeadByType()method 
public function getBeadByType(classOrInterface:Class):IBead

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Find a bead on the strand.

Parameters

classOrInterface:Class — The class or interface to use to search for the bead

Returns
IBead — The bead.
getElementAt()method 
public function getElementAt(index:int):Object

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Get a component from the parent.

Parameters

index:int — The index of the subcomponent.

Returns
Object
getElementIndex()method 
public function getElementIndex(c:Object):int

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Gets the index of this subcomponent.

Parameters

c:Object — The subcomponent to add.

Returns
int — The index (zero-based).
initialize()method 
protected function initialize():void

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

This method gets called when all preinitialize handlers no longer call preventDefault();

removeBead()method 
public function removeBead(value:IBead):IBead

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Remove a bead from the strand.

Parameters

value:IBead — bead The bead to be removed.

Returns
IBead
removeElement()method 
public function removeElement(c:Object, dispatchEvent:Boolean = true):void

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Remove a component from the parent.

Parameters

c:Object — The subcomponent to remove.
 
dispatchEvent:Boolean (default = true) — Whether to dispatch an event after removing the child.

Event Detail
applicationComplete Event
Event Object Type: org.apache.flex.events.Event

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Dispatched at startup after the initial view has been put on the display list.

initialize Event  
Event Object Type: org.apache.flex.events.Event

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Dispatched at startup. Attributes and sub-instances of the MXML document have been created and assigned. The component lifecycle is different than the Flex SDK. There is no creationComplete event.

preinitialize Event  
Event Object Type: org.apache.flex.events.Event

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Dispatched at startup before the instances get created. Beads can call preventDefault and defer initialization. This event will be dispatched on every frame until no listeners call preventDefault(), then the initialize() method will be called.

viewChanged Event  
Event Object Type: org.apache.flex.events.Event

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Dispatched at startup after the initial view has been put on the display list. This event is sent before applicationComplete is dispatched.