XMLLoader
- class XMLLoader extends Sprite
The XMLLoader class makes it possible to load external XML data once or recursively. The XML data is then stored for later use. If recursively loading data; each synchronization is compared with a cached version of the data and dispatches the SyncEvent.SYNC when the values within the XML data are different. Using the addList() and clearList() functions allows you to manage multiple subsets of the XML data for later use.
Note: When content is being loaded from a different domain or sandbox, the properties of the content may be inaccessible for security reasons. For more information about how domain security affects the load process, see the Loader class.
Property summary
| Property | Description |
|---|---|
| activeSync:Boolean | Gets or sets the activeSync property. |
| autoLoad:Boolean | Gets or sets a value that indicates whether the XMLLoader instance automatically loads the specified content. |
| data:XML | A reference to the XML data loaded from the source property or load() function. |
| library:Object | A reference to the library Object. Returns an Object of XMLLists created by the addList() function. |
| source:String | Gets or sets an absolute or relative URL that identifies the location of the XML file. |
| syncInterval:Number | Gets or sets the time in milliseconds between activeSync re-loads. |
Method summary
| Method | Description |
|---|---|
| load(src:String, method:String, params:Object) : void | Loads the specified content or, if no content is specified, loads the content from the location identified by the source property. This function is preferred if you need to pass variables to the URL of your XML or webservice. |
| addList(nodes:String) : Object | Creates a new XMLList object and adds it to the library object. The XMLList can be referenced by the getList() function. |
| clearList(nodes:String) : Object | Clears the specified XMLList from the library object |
| getList(nodes:String) : Object | Gets the specified XMLList from the library object |
| sync(event:*) : void | Initiates the synchronization process |
XMLLoader()
Description
Creates a new XMLLoader instance
load(src:String, method:String, params:Object) :void
Usage
public function load(src:String = null, method:String = null, params:Object = null):void
Parameters
src:String
- The URL or relative path of the XML or web service to load.
method:String
- Specifies the HTTP form submission method.
params:Object
- REST variables to send to the XML or web service.
Returns
Nothing.
Description
Loads the specified content or, if no content is specified, loads the content from the location identified by the source property. This function is preferred if you need to pass variables to the URL of your XML or web service.
See Also
addList(nodes:String) : Object
Usage
public function addList(nodes:String):Object
Parameters
nodes:String
- A string that identifies which nodes to reference in the source XML file.
Returns
Nothing.
Description
Creates a new XMLList object and adds it to the library object. The XMLList can be referenced by the getList() function.
See Also
clearList(), getList(), library
clearList(nodes:String) : Object
Usage
public function clearList(nodes:String):Object
Parameters
nodes:String
- A string that identifies which node list to remove.
Returns
Nothing.
Description
Clears the specified XMLList from the library object
See Also
getList(nodes:String) : Object
Usage
public function getList(nodes:String):Object
Parameters
nodes:String
- A string that identifies which node list to reference.
Returns
Nothing.
Description
Gets the specified XMLList from the library object
See Also
addList(), clearList(), library
sync(event:*) : void
Usage
public function sync(event:* = null):void
Returns
Nothing.
Description
Initiates the synchronization process
activeSync : Boolean
Usage
public function get activeSync():Boolean
Description
Gets or sets the activeSync property.
See Also
autoLoad : Boolean
Usage
public function get autoLoad():Boolean
Description
Gets or sets a value that indicates whether the XMLLoader instance automatically loads the specified content.
See Also
data : XML
Usage
public function get data():XML
Description
A reference to the XML data loaded from the source property or load() function.
library : Object
Usage
public function get library():Object
Description
A reference to the library Object. Returns an Object of XMLLists created by the addList() function.
See Also
addList(), clearList(), XMLList()
source : String
Usage
public function get source():String
Description
Gets or sets an absolute or relative URL that identifies the location of the XML file.
syncInterval : Number
Usage
public function get syncInterval():Number
Description
Gets or sets the time in milliseconds between activeSync re-loads.