DataLoad

Kind of class:public class
Package:org.casalib.load
Inherits from:LoadItem < BaseLoadItem < Process < RemovableEventDispatcher < EventDispatcher
Version:11/02/08
Author:Aaron Clinger
Classpath:org.casalib.load.DataLoad
File last modified:Wednesday, 31 December 2008, 20:18:28
Provides an easy and standardized way to load data.
Example:
  • package {
        import flash.display.MovieClip;
        import org.casalib.events.LoadEvent;
        import org.casalib.load.DataLoad;
    
    
        public class MyExample extends MovieClip {
            protected var _dataLoad:DataLoad;
    
    
            public function MyExample() {
                super();
    
                this._dataLoad = new DataLoad("data.xml");
                this._dataLoad.addEventListener(LoadEvent.COMPLETE, this._onComplete);
                this._dataLoad.start();
            }
    
            protected function _onComplete(e:LoadEvent):void {
                trace(this._dataLoad.dataAsXml.toXMLString());
            }
        }
    }
Events broadcasted to listeners:
  • Event with type: OPEN - Dispatched when a load operation starts.
  • HTTPStatusEvent with type: HTTP_STATUS - Dispatched if class is able to detect and return the status code for the request.
  • SecurityErrorEvent with type: SECURITY_ERROR - Dispatched if load is outside the security sandbox.

Summary


Constructor
  • DataLoad (request:*)
    • Creates and defines a DataLoad.
Class properties
Class properties inherited from Process
Instance properties
  • urlLoader : URLLoader
    • The URLLoader being used to download the data.
  • data : *
    • The data received from the DataLoad.
  • dataAsXml : XML
    • The data received from the DataLoad data typed as XML.
  • dataAsUrlVariables : URLVariables
    • The data received from the DataLoad data typed as URLVariables.

Constructor

DataLoad

public function DataLoad (
request:*)

Creates and defines a DataLoad.
Parameters:
request:
A String or an URLRequest reference to the file you wish to load.

Instance properties

data

public data:*
(read)

The data received from the DataLoad. Available after load is complete.

dataAsUrlVariables

public dataAsUrlVariables:URLVariables
(read)

The data received from the DataLoad data typed as URLVariables. Available after load is complete.

dataAsXml

public dataAsXml:XML
(read)

The data received from the DataLoad data typed as XML. Available after load is complete.

urlLoader

public urlLoader:URLLoader
(read)

The URLLoader being used to download the data.

Instance methods

destroy

override public function destroy (
) : void

Overrides: