Guide de référence ActionScript® 3.0 pour la plate-forme Adobe® Flash®
Accueil  |  Masquer la liste des packages et des classes |  Packages  |  Classes  |  Nouveautés  |  Index  |  Annexes  |  Pourquoi existe-t-il du contenu en anglais ?
Filtres : Récupération des données du serveur...
Récupération des données du serveur...
com.adobe.icomm.assetplacement.controller 

XMLDataLoader  - AS3 Asset Placement

Packagecom.adobe.icomm.assetplacement.controller
Classepublic class XMLDataLoader
HéritageXMLDataLoader Inheritance EventDispatcher Inheritance Object
Implémente IMXMLObject, IPackageObject

Version du langage: ActionScript 3.0
Version du produit: Bloc de création Asset Placement 9.5
Versions du moteur d’exécution: AIR 1.0, Flash Player 9, Flash Player 10

XMLDataLoader is used to load a resource from the package definition that points to an XML data file. The XMLDataLoader is linked to an asset in the package definition through its 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.

Consulter les exemples



Propriétés publiques
 PropriétéDéfini par
  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
 Inheritedconstructor : Object
Référence à l’objet de classe ou à la fonction constructeur d’une occurrence donnée d’un objet.
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
[lecture seule] A list of Attachment objects who's controller id attribute matches the id of this object.
XMLDataLoader
  packageController : Controller
[lecture seule] The controller object who's id matches the id of this object.
XMLDataLoader
  packageResource : Resource
[lecture seule] The current Resource object who's controller id attribute matches the id of this object.
XMLDataLoader
  packageResources : IList
[lecture seule] A list of Resource objects who's controller id attribute matches the id of this object.
XMLDataLoader
Méthodes publiques
 MéthodeDéfini par
  
Constructor.
XMLDataLoader
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Enregistre un objet écouteur d’événement auprès d’un objet EventDispatcher afin que l’écouteur soit averti d’un événement.
EventDispatcher
 Inherited
Distribue un événement dans le flux d’événements.
EventDispatcher
 Inherited
Vérifie si des écouteurs sont enregistrés auprès de l’objet EventDispatcher pour un type spécifique d’événement.
EventDispatcher
 Inherited
Indique si la propriété spécifiée d’un objet est définie.
Object
 Inherited
Indique si une occurrence de la classe Object figure dans la chaîne de prototype de l’objet spécifié en tant que paramètre.
Object
  
This method loads the XML data associated to the id property in the package definition file.
XMLDataLoader
 Inherited
Indique si la propriété spécifiée existe et est énumérable.
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Supprime un écouteur de l’objet EventDispatcher.
EventDispatcher
 Inherited
Définit la disponibilité d’une propriété dynamique pour les opérations en boucle.
Object
 Inherited
Renvoie la représentation de chaîne de cet objet, formatée selon les paramètres régionaux en vigueur.
Object
 Inherited
Renvoie la représentation sous forme de chaîne de l’objet spécifié.
Object
 Inherited
Renvoie la valeur primitive de l’objet spécifié.
Object
 Inherited
Vérifie si un écouteur d’événement est enregistré auprès de cet objet EventDispatcher ou de ses ancêtres pour le type d’événement spécifié.
EventDispatcher
Evénements
 Evénement Synthèse Défini par
 Inherited[Evénement de diffusion] Distribué lorsque l’application Flash Player obtient le focus du système d’exploitation et devient active.EventDispatcher
 Inherited[Evénement de diffusion] Distribué lorsque l’application Flash Player ou AIR perd le focus du système d’exploitation et devient inactive.EventDispatcher
  Dispatched when new content is loaded after calling loadData() or when changing the id property, if autoLoad is set to true.XMLDataLoader
Détails de la propriété

autoLoad

propriété
autoLoad:Boolean

Version du langage: ActionScript 3.0
Version du produit: Bloc de création Asset Placement 9.5
Versions du moteur d’exécution: 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.

La valeur par défaut est true.



Implémentation
    public function get autoLoad():Boolean
    public function set autoLoad(value:Boolean):void

id

propriété 
id:String

Version du langage: ActionScript 3.0
Version du produit: Bloc de création Asset Placement 9.5
Versions du moteur d’exécution: 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.



Implémentation
    public function get id():String
    public function set id(value:String):void

packageAttachments

propriété 
packageAttachments:IList  [lecture seule]

Version du langage: ActionScript 3.0
Version du produit: Bloc de création Asset Placement 9.5
Versions du moteur d’exécution: 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.



Implémentation
    public function get packageAttachments():IList

packageController

propriété 
packageController:Controller  [lecture seule]

Version du langage: ActionScript 3.0
Version du produit: Bloc de création Asset Placement 9.5
Versions du moteur d’exécution: AIR 1.0, Flash Player 9, Flash Player 10

The controller object who's id matches the id of this object.



Implémentation
    public function get packageController():Controller

packageResource

propriété 
packageResource:Resource  [lecture seule]

Version du langage: ActionScript 3.0
Version du produit: Bloc de création Asset Placement 9.5
Versions du moteur d’exécution: AIR 1.0, Flash Player 9, Flash Player 10

The current Resource object who's controller id attribute matches the id of this object.



Implémentation
    public function get packageResource():Resource

packageResources

propriété 
packageResources:IList  [lecture seule]

Version du langage: ActionScript 3.0
Version du produit: Bloc de création Asset Placement 9.5
Versions du moteur d’exécution: 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.



Implémentation
    public function get packageResources():IList
Détails du constructeur

XMLDataLoader

()Constructeur
public function XMLDataLoader(id:String = "")

Version du langage: ActionScript 3.0
Version du produit: Bloc de création Asset Placement 9.5
Versions du moteur d’exécution: AIR 1.0, Flash Player 9, Flash Player 10

Constructor.

Paramètres
id:String (default = "") — Set the id property when constructing the object.
Détails de la méthode

loadData

()méthode
public function loadData():void

Version du langage: ActionScript 3.0
Version du produit: Bloc de création Asset Placement 9.5
Versions du moteur d’exécution: 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.

Eléments de l’API associés

Détails de l’événement

xmlDataReady

Evénement
Type d’objet d’événement: com.adobe.icomm.assetplacement.controller.XMLDataReadyEvent
propriété XMLDataReadyEvent.type = com.adobe.icomm.assetplacement.controller.XMLDataReadyEvent.XML_DATA_READY

Version du langage: ActionScript 3.0
Version du produit: Bloc de création Asset Placement 9.5
Versions du moteur d’exécution: 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.

A value that represents the Event name.
This class can be used in ActionScript as follows:
     
     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>
     
     




[ X ]Pourquoi existe-t-il du contenu en anglais ?
Certaines parties du Guide de référence ActionScript 3.0 sont en anglais

Tout le contenu du Guide de référence ActionScript 3.0 n’a pas été traduit dans toutes les langues. Si un élément de langage n’est pas traduit, il s’affiche en anglais. Par exemple, la classe ga.controls.HelpBox n’est traduite dans aucune langue. Ainsi, dans la version française du guide de référence, la classe ga.controls.HelpBox apparaît en anglais.