Package | com.adobe.icomm.assetplacement.controller |
Class | public class XMLDataLoader |
Inheritance | XMLDataLoader EventDispatcher Object |
Implements | IMXMLObject, IPackageObject |
Language Version: | ActionScript 3.0 |
Product Version: | Asset Placement Building Block 9.5 |
Runtime Versions: | AIR 1.0, Flash Player 9, Flash Player 10 |
id
.
If autoLoad
is true, then whenever the id
property is changed, the data linked
to the new id will be loaded. If autoLoad
is false, then an explicit call to loadData() must
be made to load the package XML resource. Once the XML data is loaded and ready to use, an XmlDataReadyEvent
is dispatched.
Property | Defined By | ||
---|---|---|---|
autoLoad : Boolean
A flag that indictes whether content starts loading automatically when the id
is set or waits for a call to the loadData() method. | XMLDataLoader | ||
constructor : Object
A reference to the class object or constructor function for a given object instance. | Object | ||
id : String
The id of this object, which is used to link up to the controller attribute
in the assets section of the package definition file. | XMLDataLoader | ||
packageAttachments : IList [read-only]
A list of Attachment objects who's controller id attribute matches the
id of this object. | XMLDataLoader | ||
packageController : Controller [read-only]
The controller object who's id matches the id of this object. | XMLDataLoader | ||
packageResource : Resource [read-only]
The current Resource object who's controller id attribute matches the
id of this object. | XMLDataLoader | ||
packageResources : IList [read-only]
A list of Resource objects who's controller id attribute matches the
id of this object. | XMLDataLoader | ||
prototype : Object [static]
A reference to the prototype object of a class or function object. | Object |
Method | Defined By | ||
---|---|---|---|
XMLDataLoader(id:String = "")
Constructor. | XMLDataLoader | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener
receives notification of an event. | EventDispatcher | ||
Dispatches an event into the event flow. | EventDispatcher | ||
Checks whether the EventDispatcher object has any listeners registered for a specific type
of event. | EventDispatcher | ||
Indicates whether an object has a specified property defined. | Object | ||
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | ||
This method loads the XML data associated to the id property in the package
definition file. | XMLDataLoader | ||
Indicates whether the specified property exists and is enumerable. | Object | ||
Removes a listener from the EventDispatcher object. | EventDispatcher | ||
Sets the availability of a dynamic property for loop operations. | Object | ||
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | ||
Returns the string representation of the specified object. | Object | ||
Returns the primitive value of the specified object. | Object | ||
Checks whether an event listener is registered with this EventDispatcher object or any of
its ancestors for the specified event type. | EventDispatcher |
Event | Summary | Defined By | ||
---|---|---|---|---|
[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. | EventDispatcher | |||
[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. | EventDispatcher | |||
Dispatched when new content is loaded after calling loadData() or when changing the id property, if autoLoad is set to true. | XMLDataLoader |
autoLoad | property |
autoLoad:Boolean
Language Version: | ActionScript 3.0 |
Product Version: | Asset Placement Building Block 9.5 |
Runtime Versions: | AIR 1.0, Flash Player 9, Flash Player 10 |
A flag that indictes whether content starts loading automatically when the id
is set or waits for a call to the loadData()
method.
If true
, the content loads automatically.
If false
, you must call the loadData()
method.
The default value is true.
Implementation
public function get autoLoad():Boolean
public function set autoLoad(value:Boolean):void
id | property |
id:String
Language Version: | ActionScript 3.0 |
Product Version: | Asset Placement Building Block 9.5 |
Runtime Versions: | AIR 1.0, Flash Player 9, Flash Player 10 |
The id of this object, which is used to link up to the controller
attribute
in the assets section of the package definition file.
Implementation
public function get id():String
public function set id(value:String):void
packageAttachments | property |
packageAttachments:IList
[read-only] Language Version: | ActionScript 3.0 |
Product Version: | Asset Placement Building Block 9.5 |
Runtime Versions: | AIR 1.0, Flash Player 9, Flash Player 10 |
A list of Attachment
objects who's controller
id
attribute matches the
id
of this object.
Implementation
public function get packageAttachments():IList
packageController | property |
packageController:Controller
[read-only] Language Version: | ActionScript 3.0 |
Product Version: | Asset Placement Building Block 9.5 |
Runtime Versions: | AIR 1.0, Flash Player 9, Flash Player 10 |
The controller object who's id
matches the id
of this object.
Implementation
public function get packageController():Controller
packageResource | property |
packageResource:Resource
[read-only] Language Version: | ActionScript 3.0 |
Product Version: | Asset Placement Building Block 9.5 |
Runtime Versions: | AIR 1.0, Flash Player 9, Flash Player 10 |
The current Resource
object who's controller
id
attribute matches the
id
of this object.
Implementation
public function get packageResource():Resource
packageResources | property |
packageResources:IList
[read-only] Language Version: | ActionScript 3.0 |
Product Version: | Asset Placement Building Block 9.5 |
Runtime Versions: | AIR 1.0, Flash Player 9, Flash Player 10 |
A list of Resource
objects who's controller
id
attribute matches the
id
of this object.
Implementation
public function get packageResources():IList
XMLDataLoader | () | Constructor |
loadData | () | method |
public function loadData():void
Language Version: | ActionScript 3.0 |
Product Version: | Asset Placement Building Block 9.5 |
Runtime Versions: | AIR 1.0, Flash Player 9, Flash Player 10 |
This method loads the XML data associated to the id
property in the package
definition file. When the data is ready for use, an xmlDataReady event is dispatched. The event
contains the data.
Related API Elements
xmlDataReady | Event |
com.adobe.icomm.assetplacement.controller.XMLDataReadyEvent
property XMLDataReadyEvent.type =
com.adobe.icomm.assetplacement.controller.XMLDataReadyEvent.XML_DATA_READY
Language Version: | ActionScript 3.0 |
Product Version: | Asset Placement Building Block 9.5 |
Runtime Versions: | AIR 1.0, Flash Player 9, Flash Player 10 |
Dispatched when new content is loaded after calling loadData()
or when changing the id
property, if autoLoad
is set to true.
public function foo():void { var xmlDataLoader:XMLDataLoader = new XMLDataLoader(); xmlDataLoader.autoLoad = false; xmlDataLoader.id = "data"; xmlDataLoader.addEventListener(XMLDataReadyEvent.XML_DATA_READY, xmlDataReadyHandler); xmlDataLoader.loadData(); } private function xmlDataReadyHandler(event:XMLDataReadyEvent):void { var root:XML = event.data; // Do stuff with the XML... }
The XMLDataLoader can also be used in MXML:
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:ap="http://ns.adobe.com/livecycle/icomm/assetplacement"> <mx:Script> <![CDATA[ // Called when XMLDataLoader loads data private function onXMLDataReady(event:XMLDataReadyEvent):void { var info:XML = event.data; StatementDataText.data = info.PhoneBill; } ]]> </mx:Script> <ap:XMLDataLoader id="data" xmlDataReady="onXMLDataReady(event)"/> </mx:Module>
Mon Nov 28 2011, 06:48 AM -08:00