| Package | vegas.net |
| Class | public class ApplicationLoader |
| Inheritance | ApplicationLoader ObjectFactoryLoader Task Object |
Example : "hello world"
1 - The top-level context eden application file : "hello_world.eden"
objects =
[
{
id : "my_format" ,
type : "flash.text.TextFormat" ,
arguments : [ { value:"arial" } , { value:24 } , { value:0xFEF292 } , { value:true } ]
}
,
{
id : "my_field" ,
type : "flash.text.TextField" ,
properties :
[
{ name : "autoSize" , value : "left" } ,
{ name : "defaultTextFormat" , ref : "my_format" } ,
{ name : "text" , value : "HELLO WORLD" } ,
{ name : "x" , value : 10 } ,
{ name : "y" , value : 10 }
]
}
,
{
id : "stage" ,
type : "flash.display.Stage" ,
factoryReference : "#stage" ,
singleton : true ,
properties :
[
{ name : "align" , value:"" } ,
{ name : "scaleMode" , value:"noScale" }
]
}
,
{
id : "root" ,
type : "flash.display.MovieClip" ,
factoryReference : "#root" ,
singleton : true ,
properties :
[
{ name : "addChild" , arguments : [ { ref:"my_field" } ]}
]
}
] ;
2 - The main source code :
import system.events.ActionEvent;
import vegas.net.ApplicationLoader;
var debug:Function = function( e:Event ):void
{
trace( e ) ;
}
var loader:ApplicationLoader = new ApplicationLoader( "hello_world.eden" , "context/" ) ;
loader.root = this ;
loader.addEventListener( ActionEvent.START , debug ) ;
loader.addEventListener( ActionEvent.FINISH , debug ) ;
loader.run() ;
| Property | Defined By | ||
|---|---|---|---|
![]() | context : String
The default context file uri value. | ObjectFactoryLoader | |
![]() | factory : ObjectFactory
The IoC factory reference. | ObjectFactoryLoader | |
![]() | finishIt : Signaler
This signal emit when the notifyFinished method is invoked. | Task | |
![]() | flashVars : FlashVars
The flashVars reference of the application. | ObjectFactoryLoader | |
| localization : Localization
Determinates the Localization reference of this loader. | ApplicationLoader | ||
![]() | logger : Logger
Determinates the internal Logger reference of this Loggable object. | Task | |
![]() | path : String
The default path of the external context file. | ObjectFactoryLoader | |
![]() | phase : String [read-only]
The current phase of the action. | Task | |
![]() | resourceInfo : ObjectResourceInfo [read-only]
Returns the ObjectResourceInfo object corresponding to the current resource being loaded. | ObjectFactoryLoader | |
![]() | root : DisplayObjectContainer
The root reference of the application. | ObjectFactoryLoader | |
![]() | running : Boolean [read-only]
Indicates true if the process is in progress. | Task | |
![]() | stage : Stage
The Stage reference of the application. | ObjectFactoryLoader | |
![]() | startIt : Signaler
This signal emit when the notifyStarted method is invoked. | Task | |
![]() | verbose : Boolean
Switch the verbose mode of this loader. | ObjectFactoryLoader | |
| Method | Defined By | ||
|---|---|---|---|
ApplicationLoader(context:String = application.eden, path:String, factory:ObjectFactory = null, config:Config = null, localization:Localization = null)
Creates a new ApplicationLoader instance. | ApplicationLoader | ||
![]() | clear():void
Clear all the resources in the loader and reset it. | ObjectFactoryLoader | |
![]() | clone():*
Returns a shallow copy of this object. | Task | |
![]() | create():void
Creates the objects. | ObjectFactoryLoader | |
![]() | isLocked():Boolean
Returns true if the object is locked. | Task | |
![]() | lock():void
Locks the object. | Task | |
![]() | notifyFinished():void
Notify an ActionEvent when the process is finished. | Task | |
![]() | notifyStarted():void
Notify an ActionEvent when the process is started. | Task | |
![]() | registerFactory():void
Register the current factory reference of this loader. | ObjectFactoryLoader | |
![]() | run(... arguments):void [override]
Run the process. | ObjectFactoryLoader | |
setConfigTarget(config:Config):void
Defines the Config reference of this loader. | ApplicationLoader | ||
![]() | unlock():void
Unlocks the display. | Task | |
![]() | unregisterFactory():void
Unregister the current factory referenceof this loader. | ObjectFactoryLoader | |
| Method | Defined By | ||
|---|---|---|---|
![]() | addResource(resource:ObjectResource):Boolean
This method is the strategy to insert a new ObjectResource in the sequencer. | ObjectFactoryLoader | |
![]() |
Invoked when the current task in the sequencer is changed. | ObjectFactoryLoader | |
![]() |
Invoked when the factory is complete. | ObjectFactoryLoader | |
![]() | setRunning(b:Boolean):void
Changes the running property value. | Task | |
updateLocalization(e:LocalizationEvent = null):void
Invoked when the localization of the application is changed or to update the locale object of
the IoC factory configuration with the current locale object of the application. | ApplicationLoader | ||
| localization | property |
localization:LocalizationDeterminates the Localization reference of this loader.
public function get localization():Localization public function set localization(value:Localization):void| ApplicationLoader | () | Constructor |
public function ApplicationLoader(context:String = application.eden, path:String, factory:ObjectFactory = null, config:Config = null, localization:Localization = null)Creates a new ApplicationLoader instance.
Parameterscontext:String (default = application.eden) — The uri of the context external eden file (default "application.eden").
| |
path:String — The optional path of the external context file (default "").
| |
factory:ObjectFactory (default = null) — The optional ObjectFactory reference of this loader. By default the loader use the ECMAObjectFactory.getInstance() reference.
| |
config:Config (default = null) — The internal parse loader class to use to load all external context files (optional EdenLoader).
| |
localization:Localization (default = null) |
| setConfigTarget | () | method |
public function setConfigTarget(config:Config):voidDefines the Config reference of this loader. If you change the factory of this loader don't forget to actualize this method.
Parameters
config:Config |
| updateLocalization | () | method |
protected function updateLocalization(e:LocalizationEvent = null):voidInvoked when the localization of the application is changed or to update the locale object of the IoC factory configuration with the current locale object of the application.
Parameters
e:LocalizationEvent (default = null) |