| Package | com.bourre.ioc.load.runtime |
| Class | public class RuntimeContextLoader |
| Inheritance | RuntimeContextLoader ApplicationLoader AbstractLoader |
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
All loaded objects ( dll, resources, display tree ) are injected into global IoC context.
var rtLoader : RuntimeContextLoader = new RuntimeContextLoader( ); rtLoader.addEventListener( ApplicationLoaderEvent.onApplicationInitEVENT, _onComplete ); rtLoader.load( new URLRequest( "config/runtimeContext.xml" ) );
| Property | Defined by | ||
|---|---|---|---|
![]() | DEBUG_LOADING_ENABLED : Boolean = false [static] Enabled or not the debugging feature during application loading.
| ApplicationLoader | |
![]() | DEFAULT_CONFIG_PATH : String = "" [static] Default path for applicationContext file.
| ApplicationLoader | |
![]() | DEFAULT_CONTEXT_FILE : String = "" [static] Default URL for applicationContext file.
| ApplicationLoader | |
![]() | DEFAULT_DLL_PATH : String = "" [static] Default path for dll files.
| ApplicationLoader | |
![]() | DEFAULT_GFX_PATH : String = "" [static] Default path for gfx ( display tree ) files.
| ApplicationLoader | |
![]() | DEFAULT_RSC_PATH : String = "" [static] Default path for resources files.
| ApplicationLoader | |
![]() | RELATIVE_PATH : String = "#//" [static]
Defines wildcard to search to identify a forced relative path.
| ApplicationLoader | |
| sandbox : Boolean
Defines if context links ( url ) are relative to the loaded xml
context file.
| RuntimeContextLoader | ||
| Method | Defined by | ||
|---|---|---|---|
|
RuntimeContextLoader(container:DisplayObjectContainer = null)
Creates new
RuntimeContextLoader instance. | RuntimeContextLoader | ||
![]() |
addApplicationLoaderListener(listener:ApplicationLoaderListener):Boolean
Adds the passed-in
listener as listener for all
events dispatched by loader. | ApplicationLoader | |
![]() |
addASyncCommandListener(listener:ASyncCommandListener, ... rest):Boolean
Adds the passed-in command listener object as listener
for this command events.
| AbstractLoader | |
![]() |
addEventListener(type:String, listener:Object, ... rest):Boolean
Adds an event listener for the specified event type.
| AbstractLoader | |
![]() |
addListener(listener:LoaderListener):Boolean
Adds the passed-in listener as listener for all events dispatched
by this event broadcaster.
| AbstractLoader | |
![]() |
addProcessingMethod(processingMethod:Function, ... args):void
Adds new preprocessing method.
| ApplicationLoader | |
![]() |
addProcessor(processor:ContextProcessor):void
Adds new pre processing processor.
| ApplicationLoader | |
![]() |
execute(e:Event = null):void
Execute the request according to the current command data.
| AbstractLoader | |
![]() |
fireCommandEndEvent():void
Fires the
onCommandEnd event to the listeners of this command. | AbstractLoader | |
![]() |
fireOnApplicationInit():void
Broadcasts
ApplicationLoaderEvent.onApplicationInitEVENT
event type when application is ready. | ApplicationLoader | |
![]() |
fireOnApplicationParsed():void
Broadcasts
ApplicationLoaderEvent.onApplicationParsedEVENT
event type when xml is parsed. | ApplicationLoader | |
![]() |
fireOnApplicationStart():void
Broadcasts
ApplicationLoaderEvent.onApplicationStartEVENT
event type when xml is parsed. | ApplicationLoader | |
![]() |
fireOnApplicationState(state:String):void
Broadcasts
ApplicationLoaderEvent.onApplicationStateEVENT when IOC engine
processing change his state ( DLL, Resources, GFX, etc. | ApplicationLoader | |
![]() |
fireOnChannelsAssigned():void
Broadcasts
ApplicationLoaderEvent.onApplicationChannelsAssignedEVENT
event type when all plugin channels are initialized. | ApplicationLoader | |
![]() |
fireOnLoadErrorEvent(message:String = ""):void
Dispatches event when an error occur.
| AbstractLoader | |
![]() |
fireOnLoadInitEvent():void
Dispatches event when the loading is finished.
| AbstractLoader | |
![]() |
fireOnLoadProgressEvent():void
Dispatches event during loading progression.
| AbstractLoader | |
![]() |
fireOnLoadStartEvent():void
Dispatches event when the loading starts.
| AbstractLoader | |
![]() |
fireOnLoadTimeOut():void
| AbstractLoader | |
![]() |
fireOnMethodsCalled():void
Broadcasts
ApplicationLoaderEvent.onApplicationMethodsCalledEVENT
event type when all method-call are executed. | ApplicationLoader | |
![]() |
fireOnObjectsBuilt():void
Broadcasts
ApplicationLoaderEvent.onApplicationObjectsBuiltEVENT
event type when all elements in xml are built. | ApplicationLoader | |
![]() |
Returns
ApplicationAssembler used in by this loader. | ApplicationLoader | |
![]() |
getBytesLoaded():uint
Returns the number of bytes loaded.
| AbstractLoader | |
![]() |
getBytesTotal():uint
Returns the total number of bytes to load.
| AbstractLoader | |
![]() |
getContent():Object
Returns loaded content.
| AbstractLoader | |
|
getContextURL(filename:String):URLRequest
[static]
Returns
URLRequest using internal IoC url manager. | RuntimeContextLoader | ||
![]() |
Returns the
DisplayObjectBuilder used by this loader
to load and build all context elements. | ApplicationLoader | |
![]() |
getName():String
Returns the loader identifier.
| AbstractLoader | |
![]() |
Returns parser collection used by assembler.
| ApplicationLoader | |
![]() |
getPerCent():Number
Returns a percentage of bytes loaded and total bytes to load.
| AbstractLoader | |
![]() |
Returns loading strategy used by the loader.
| AbstractLoader | |
![]() |
getTimeOut():Number
Returns the loading timeout limit
| AbstractLoader | |
![]() |
getURL():URLRequest
Returns the URL used by this loader.
| AbstractLoader | |
![]() |
getURLRequest(request:URLRequest, prefix:String = ""):URLRequest
[static]
Returns clean URL address using passed-in base url and optional prefix one.
| ApplicationLoader | |
|
hasContainer():Boolean
Returns
true if a container target is defined for
loaded display tree. | RuntimeContextLoader | ||
![]() |
isAntiCache():Boolean
Returns
true if 'anticache' system is on. | AbstractLoader | |
![]() |
isLoaded():Boolean
Returns
true if all bytes are loaded. | AbstractLoader | |
![]() |
isRunning():Boolean
Returns
true if this object is running. | AbstractLoader | |
![]() |
load(url:URLRequest = null, context:LoaderContext = null):void
Starts loading.
| ApplicationLoader | |
![]() |
Triggered when a display object is built.
| ApplicationLoader | |
![]() |
onDisplayLoaderInit(e:ValueObjectEvent):void
Triggered when a display loader is registred.
| ApplicationLoader | |
![]() |
All files in xml context are loaded.
| ApplicationLoader | |
![]() |
Triggered when context files starts processing.
| ApplicationLoader | |
![]() |
Triggered when a graphic file loading is finished.
| ApplicationLoader | |
![]() |
Triggered when a graphic file starts loading.
| ApplicationLoader | |
![]() |
Triggered when a DLL file loading is finished.
| ApplicationLoader | |
![]() |
Triggered when a DLL file starts loading.
| ApplicationLoader | |
![]() |
onLoadError(e:LoaderEvent):void
| ApplicationLoader | |
![]() |
onLoadInit(e:LoaderEvent):void
| ApplicationLoader | |
![]() |
onLoadProgress(e:LoaderEvent):void
| ApplicationLoader | |
![]() |
onLoadStart(e:LoaderEvent):void
| ApplicationLoader | |
![]() |
onLoadTimeOut(e:LoaderEvent):void
| ApplicationLoader | |
![]() |
onPreprossorComplete(event:BasicEvent):void
Preprocessing is completed.
| ApplicationLoader | |
![]() |
Triggered when a resource file loading is finished.
| ApplicationLoader | |
![]() |
Triggered when a resource file starts loading.
| ApplicationLoader | |
|
parseContext(xml:*):void
| RuntimeContextLoader | ||
![]() |
prefixURL(sURL:String):void
Adds prefix to URL passed to the loader instance.
| AbstractLoader | |
|
processParsing(xml:*):void
Parses the xml context.
| RuntimeContextLoader | ||
![]() |
release():void
Releases instance and all registered listeners.
| AbstractLoader | |
![]() |
removeApplicationLoaderListener(listener:ApplicationLoaderListener):Boolean
Removes the passed-in
listener object from loader. | ApplicationLoader | |
![]() |
removeASyncCommandListener(listener:ASyncCommandListener):Boolean
Removes the passed-in command listener object as listener
for this command events.
| AbstractLoader | |
![]() |
removeEventListener(type:String, listener:Object):Boolean
Removes the passed-in listener for listening the specified event.
| AbstractLoader | |
![]() |
removeListener(listener:LoaderListener):Boolean
Removes the passed-in listener object from this event
broadcaster.
| AbstractLoader | |
![]() |
run():void
Starts the asynchronous process of this runnable object.
| AbstractLoader | |
![]() |
runPreprocessor(xml:*):void
Starts IoC pre processing.
| ApplicationLoader | |
![]() |
setAntiCache(b:Boolean):void
Sets the 'anticache' system to
true to add timestamp value
to the loaded URL. | AbstractLoader | |
![]() |
setApplicationAssembler(assembler:ApplicationAssembler):void
Sets the
ApplicationAssembler to use by this loader. | ApplicationLoader | |
![]() |
setContent(content:Object):void
Uses to replace this loader content.
| AbstractLoader | |
![]() |
setDisplayObjectBuilder(displayObjectBuilder:DisplayObjectBuilder):void
Sets the
DisplayObjectBuilder to use by this loader
to load and build all context elements. | ApplicationLoader | |
![]() |
setName(sName:String):void
Sets the loader identifier.
| AbstractLoader | |
![]() |
setParserCollection(pc:ParserCollection):void
Sets the parsers collection to use in order to build context.
| ApplicationLoader | |
![]() |
setTimeOut(n:Number):void
Sets a loading timeout limit.
| AbstractLoader | |
|
setURL(request:URLRequest):void
Defined from which the URL will be loaded.
| RuntimeContextLoader | ||
![]() |
setVariable(name:String, value:Object):void
Sets new pair name / value for variable replacement when context
file will be laoded.
| ApplicationLoader | |
| Method | Defined by | ||
|---|---|---|---|
![]() |
_initParserCollection():void
| ApplicationLoader | |
![]() | ApplicationLoader | ||
![]() | ApplicationLoader | ||
![]() |
fireEvent(e:Event):void
Dispatched passed-in event to all registered listeners.
| AbstractLoader | |
![]() |
fireEventType(type:String, errorMessage:String = ""):void
Dispatches event using passed-in type and optional error message.
| AbstractLoader | |
|
getContainer(container:DisplayObjectContainer = null):DisplayObjectContainer
Retreives correct container for loaded display tree.
| RuntimeContextLoader | ||
![]() |
getLoaderEvent(type:String, errorMessage:String = ""):LoaderEvent
| ApplicationLoader | |
![]() |
initContext():void
| ApplicationLoader | |
![]() |
initQueryURL():void
Retreives Query URL.
| ApplicationLoader | |
![]() |
onInitialize():void
| AbstractLoader | |
![]() |
preprocess(xml:XML):XML
Do preprocessing actions on xml context before parsing.
| ApplicationLoader | |
![]() |
setListenerType(type:Class):void
Defines the type of listeners this event broadcaster support.
| AbstractLoader | |
| sandbox | property |
sandbox:Boolean [read-write]
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Defines if context links ( url ) are relative to the loaded xml context file.
If true, all urls must be relative to
the loaded xml context file url.
The default value is false.
public function get sandbox():Boolean
public function set sandbox(value:Boolean):void
| RuntimeContextLoader | () | constructor |
public function RuntimeContextLoader(container:DisplayObjectContainer = null)
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Creates new RuntimeContextLoader instance.
container:DisplayObjectContainer (default = null) — Container for loaded display tree
|
| getContainer | () | method |
protected function getContainer(container:DisplayObjectContainer = null):DisplayObjectContainer
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Retreives correct container for loaded display tree.
Parameterscontainer:DisplayObjectContainer (default = null) |
DisplayObjectContainer |
| getContextURL | () | method |
public static function getContextURL(filename:String):URLRequest
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns URLRequest using internal IoC url manager.
filename:String |
URLRequest — The URLRequest using internal IoC url manager.
|
| hasContainer | () | method |
public function hasContainer():Boolean
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns true if a container target is defined for
loaded display tree.
Boolean — true if a container target is defined for
loaded display tree.
|
| parseContext | () | method |
public override function parseContext(xml:*):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Parameters
xml:* |
| processParsing | () | method |
public override function processParsing(xml:*):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Parses the xml context.
Include files are loaded and preprocessing is done.
Parametersxml:* |
| setURL | () | method |
public override function setURL(request:URLRequest):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Defined from which the URL will be loaded.
Parametersrequest:URLRequest — URL to load
|
<beans>
<dll url="MonitoringPluginDLL" />
<root id="local">
<logo id="logo" url="assets/logo.jpg" visible="true" />
</root>
<plugin id="monitor" type="lowra.plugins.utils.MonitoringPlugin">
<property name="x" value="100" />
<property name="y" value="0" />
</plugin>
</beans>
package com.bourre.ioc.load.runtime
{
import com.bourre.ioc.bean.BeanFactory;
import com.bourre.ioc.context.processor.ProcessingHelper;
import com.bourre.ioc.load.ApplicationLoaderEvent;
import com.bourre.ioc.parser.ContextNodeNameList;
import com.bourre.load.LoaderEvent;
import com.bourre.log.PixlibDebug;
import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
import flash.net.URLRequest;
public class RuntimeContextLoaderSample
{
public function RuntimeContextLoaderSample()
{
var node : XML = <object id='obj2' type='Object'><property name='p4' value='hello4' /></object>;
var target : DisplayObjectContainer = BeanFactory.getInstance().locate( ContextNodeNameList.ROOT ) as DisplayObjectContainer;
var loader : RuntimeContextLoader = new RuntimeContextLoader( target );
loader.sandbox = true;
loader.addEventListener( ApplicationLoaderEvent.onApplicationInitEVENT, onLoadContext );
loader.addProcessingMethod( ProcessingHelper.changeObjectAttribute, "logo", "visible", "false" );
loader.addProcessingMethod( ProcessingHelper.changePropertyValue, "monitor", "x", 200 );
loader.addProcessingMethod( ProcessingHelper.changePropertyValue, "monitor", "y", 200 );
loader.addProcessingMethod( ProcessingHelper.addResource, "newStyle", "myStyle.css" );
loader.addProcessingMethod( ProcessingHelper.addNode, node );
loader.load( new URLRequest ( "runtime.xml" ) );
}
public function onLoadContext( e : LoaderEvent ) : void
{
PixlibDebug.INFO( "Context loaded : " + e.getLoader().getURL().url );
var mc : DisplayObject = BeanFactory.getInstance().locate( "logo" ) as DisplayObject;
mc.alpha = 0.5;
}
}
}