套件 | 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, 03:47 PM Z