Packagecom.yworks.mxml
Classpublic class ConfigTool
InheritanceConfigTool Inheritance flash.events.EventDispatcher
Implements mx.core.IMXMLObject

Convenience class which allows loading of the config file with a simple mxml element. To load the config using Actionscript, please use Config.getInstance().addEventListener(Event.COMPLETE, configComplete);

The config will be loaded when

See also

com.yworks.util.Config


Public Properties
 PropertyDefined By
  configURL : String
[write-only] Sets the URL from which the config will be loaded.
ConfigTool
  loadNow : Boolean
[write-only] When set to true, the config will be loaded as soon as the configURL is set.
ConfigTool
  waitForApplication : Boolean
[write-only] When set to true, a complete event will be fired when the application is completely initialized and the config is loaded.
ConfigTool
Public Methods
 MethodDefined By
  
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
[override] If a listener is added for the Event.COMPLETE event type, this implementation will trigger loading of the config file.
ConfigTool
  
initialized(document:Object, id:String):void
Called automatically by the MXML compiler when the ConfigTool is created using an MXML tag.
ConfigTool
Events
 Event Summary Defined By
  Dispatched when the configuration file has been parsed.ConfigTool
  Dispatched when the configuration file could not be loaded.ConfigTool
  Dispatched when the configuration file could not be loaded due to a security error.ConfigTool
Property Detail
configURLproperty
configURL:String  [write-only]

Sets the URL from which the config will be loaded.


Implementation
    public function set configURL(value:String):void
loadNowproperty 
loadNow:Boolean  [write-only]

When set to true, the config will be loaded as soon as the configURL is set.

The default value is false.


Implementation
    public function set loadNow(value:Boolean):void
waitForApplicationproperty 
waitForApplication:Boolean  [write-only]

When set to true, a complete event will be fired when the application is completely initialized and the config is loaded.

By default the application may not be initialized at the moment complete is fired. Setting this property to true allows to initialize the application in the listener for the complete event.

The default value is false.


Implementation
    public function set waitForApplication(value:Boolean):void
Method Detail
addEventListener()method
override public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void

If a listener is added for the Event.COMPLETE event type, this implementation will trigger loading of the config file.

Parameters

type:String — The type to listen for.
 
listener:Function — The listener function.
 
useCapture:Boolean (default = false)
 
priority:int (default = 0)
 
useWeakReference:Boolean (default = false)

initialized()method 
public function initialized(document:Object, id:String):void

Called automatically by the MXML compiler when the ConfigTool is created using an MXML tag.

This implementation does nothing.

Parameters

document:Object — The MXML document containing this instance.
 
id:String — The id of this instance.

Event Detail
complete Event
Event Object Type: flash.events.Event
Event.type property = flash.events.Event.COMPLETE

Dispatched when the configuration file has been parsed.

ioError Event  
Event Object Type: flash.events.IOErrorEvent
IOErrorEvent.type property = flash.events.IOErrorEvent.IO_ERROR

Dispatched when the configuration file could not be loaded.

securityError Event  
Event Object Type: flash.events.SecurityErrorEvent
SecurityErrorEvent.type property = flash.events.SecurityErrorEvent.SECURITY_ERROR

Dispatched when the configuration file could not be loaded due to a security error.