包 | com.adobe.icomm.assetplacement.controller |
类 | public class XMLDataLoader |
继承 | XMLDataLoader EventDispatcher Object |
实现 | IMXMLObject, IPackageObject |
语言版本: | ActionScript 3.0 |
产品版本: | Asset Placement Building Block 9.5 |
运行时版本: | 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.
属性 | 由以下参数定义 | ||
---|---|---|---|
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
对类对象或给定对象实例的构造函数的引用。 | 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 [只读]
A list of Attachment objects who's controller id attribute matches the
id of this object. | XMLDataLoader | ||
packageController : Controller [只读]
The controller object who's id matches the id of this object. | XMLDataLoader | ||
packageResource : Resource [只读]
The current Resource object who's controller id attribute matches the
id of this object. | XMLDataLoader | ||
packageResources : IList [只读]
A list of Resource objects who's controller id attribute matches the
id of this object. | XMLDataLoader |
方法 | 由以下参数定义 | ||
---|---|---|---|
XMLDataLoader(id:String = "")
Constructor. | XMLDataLoader | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
使用 EventDispatcher 对象注册事件侦听器对象,以使侦听器能够接收事件通知。 | EventDispatcher | ||
将事件调度到事件流中。 | EventDispatcher | ||
检查 EventDispatcher 对象是否为特定事件类型注册了任何侦听器。 | EventDispatcher | ||
表示对象是否已经定义了指定的属性。 | Object | ||
表示 Object 类的实例是否在指定为参数的对象的原型链中。 | Object | ||
This method loads the XML data associated to the id property in the package
definition file. | XMLDataLoader | ||
表示指定的属性是否存在、是否可枚举。 | Object | ||
从 EventDispatcher 对象中删除侦听器。 | EventDispatcher | ||
设置循环操作动态属性的可用性。 | Object | ||
返回此对象的字符串表示形式,其格式设置遵守区域设置特定的约定。 | Object | ||
返回指定对象的字符串表示形式。 | Object | ||
返回指定对象的原始值。 | Object | ||
检查是否用此 EventDispatcher 对象或其任何祖代为指定事件类型注册了事件侦听器。 | EventDispatcher |
事件 | 摘要 | 由以下参数定义 | ||
---|---|---|---|---|
[广播事件] Flash Player 或 AIR 应用程序获得操作系统焦点并变为活动状态时将调度此事件。 | EventDispatcher | |||
[广播事件] Flash Player 或 AIR 应用程序失去操作系统焦点并变为非活动状态时将调度此事件。 | EventDispatcher | |||
Dispatched when new content is loaded after calling loadData() or when changing the id property, if autoLoad is set to true. | XMLDataLoader |
autoLoad | 属性 |
autoLoad:Boolean
语言版本: | ActionScript 3.0 |
产品版本: | Asset Placement Building Block 9.5 |
运行时版本: | 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.
默认值为 true。
实现
public function get autoLoad():Boolean
public function set autoLoad(value:Boolean):void
id | 属性 |
id:String
语言版本: | ActionScript 3.0 |
产品版本: | Asset Placement Building Block 9.5 |
运行时版本: | 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.
实现
public function get id():String
public function set id(value:String):void
packageAttachments | 属性 |
packageController | 属性 |
packageController:Controller
[只读] 语言版本: | ActionScript 3.0 |
产品版本: | Asset Placement Building Block 9.5 |
运行时版本: | AIR 1.0, Flash Player 9, Flash Player 10 |
The controller object who's id
matches the id
of this object.
实现
public function get packageController():Controller
packageResource | 属性 |
packageResources | 属性 |
XMLDataLoader | () | 构造函数 |
loadData | () | 方法 |
public function loadData():void
语言版本: | ActionScript 3.0 |
产品版本: | Asset Placement Building Block 9.5 |
运行时版本: | 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.
相关 API 元素
xmlDataReady | 事件 |
com.adobe.icomm.assetplacement.controller.XMLDataReadyEvent
属性 XMLDataReadyEvent.type =
com.adobe.icomm.assetplacement.controller.XMLDataReadyEvent.XML_DATA_READY
语言版本: | ActionScript 3.0 |
产品版本: | Asset Placement Building Block 9.5 |
运行时版本: | 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>
Tue Jun 12 2018, 11:04 AM Z