Apache Flex (FlexJS) 0.7.0 API Reference | All Packages | All Classes | Index | Frames No Frames |
Application

Package | org.apache.flex.core
Class | public class Application
Inheritance | Application ApplicationBase 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

| Property | Defined 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
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | Application() 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
|  | info():Object An Object containing information generated by the compiler that is useful at startup time. | ApplicationBase
|  | removeBead(value:IBead):IBead Remove a bead from the strand. | Application
|  | removeElement(c:Object, dispatchEvent:Boolean = true):void Remove a component from the parent. | Application

Protected Methods

| Method | Defined By
--- | --- | ---
|  | initialize():void This method gets called when all preinitialize handlers no longer call preventDefault(); | Application

Events

| Event | Summary | Defined By
--- | --- | --- | ---
|  | applicationComplete | Dispatched at startup after the initial view has been put on the display list. | Application
|  | initialize | Dispatched at startup. | Application
|  | preinitialize | Dispatched at startup before the instances get created. | Application
|  | viewChanged | Dispatched at startup after the initial view has been put on the display list. | Application

Property Detail

beads | property

`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.

controller | property |

`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.

initialView | property |

`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

org.apache.flex.core.ViewBase

model | property |

`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.

MXMLDescriptor | property |

`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

org.apache.flex.utils.MXMLDataInterpreter

numElements | property |

`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`

valuesImpl | property |

`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

org.apache.flex.core.SimpleCSSValuesImpl
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

org.apache.flex.utils.MXMLDataInterpreter

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.

Mon Sep 5 2016, 07:19 AM -07:00