XMLWorker

Kind of class:class
Inherits from:Dispatcher
Classpath:org.asapframework.util.xml.XMLWorker
File last modified:Sunday, 05 November 2006, 11:27:56
A worker class for XML that sends an "onXMLLoaded" message when XML has been loaded.
XMLWorker is used interally by XMLLoader and should not be used by itself.
Events broadcasted to listeners:
  • onXMLLoaded event to XMLLoader
  • onXMLTimeout event to XMLLoader

Summary


Constructor
  • XMLWorker (inURL:String, inName:String, inNoCache:Boolean, inTimeOut:Number)
    • Creates a new XMLWorker object.
Class properties
Instance properties
Instance methods
Event handlers

Constructor

XMLWorker

function XMLWorker (
inURL:String, inName:String, inNoCache:Boolean, inTimeOut:Number)

Creates a new XMLWorker object.
Parameters:
inURL :
The URL of the xml file
inName :
Unique identifier; this name will also be used in callback events when file was loaded or when an error was encountered.
inNoCache:
If set to true, the xml file (if loaded over http, so this setting is ignored for local files) will always be fetched from the server by appending a timestamp to the call, thus circumventing the local browser cache. The URL will be extended with a param named 'asapts'.
inTimeOut:
Set value to specify time to wait (in milliseconds) for a server response (excluding the download time of the actual XML data itself). Defaults to 10 seconds if no value is specified. Set to '0' to disable timeout.

Class properties

TIME_OUT

static private TIME_OUT:Number = 10000
(read)

Instance properties

fpulse

private fpulse:FramePulse
(read)

loaded

loaded:Boolean
(read)

loading

loading:Boolean
(read)

mLoadDelegate

private mLoadDelegate:Function
(read)

mTimeoutID

private mTimeoutID:Number
(read)

mXML

private mXML:XML
(read)

name

name:String
(read)

noCache

noCache:Boolean
(read)

result

result:Boolean
(read)

status

status:Number
(read)

timeout

timeout:Number
(read)

url

url:String
(read)

xml

xml:XML
(read)

The XML data.

Instance methods

clearListener

private function clearListener (
) : Void

Removes the FramePulse listener.

clearTimeout

private function clearTimeout (
) : Void

Clears the timeout.

load

function load (
) : Void

Starts loading the XML file.

setTimeout

private function setTimeout (
) : Void

Starts the timeout.

startListener

private function startListener (
) : Void

Starts the FramePulse listener.

Event handlers

onEnterFrame

function onEnterFrame (
e:FramePulseEvent) : Void

Triggered by FramePulse class.

onXMLloaded

function onXMLloaded (
inResult:Boolean) : Void

Triggered when XML has been loaded.
Events broadcasted to listeners:
  • onXMLLoaded event to XMLLoader

onXMLTimeout

function onXMLTimeout (
) : Void

Triggered if no response from server was received within timeout interval.
Events broadcasted to listeners:
  • onXMLTimeout event to XMLLoader