VarsLoad

Kind of class:class
Inherits from:DataLoad < BytesLoad < RetryableLoad < Load < EventDispatcher < CoreObject
Version:07/17/07
Author:Aaron Clinger
Classpath:org.casaframework.load.data.VarsLoad
File last modified:Sunday, 19 August 2007, 13:43:24
Creates an easy way to load or send and load variables.
Since:
Flash Player 7
Example:
To load data:
function onVarsLoad(sender:VarsLoad):Void {
    trace(this.myVarsLoad.getValue("name"));
}

var myVarsLoad:VarsLoad = new VarsLoad("http://example.com/getData.php");
myVarsLoad.addEventObserver(this, VarsLoad.EVENT_LOAD_COMPLETE, "onVarsLoad");
myVarsLoad.start();

To send and load data:
function onVarsLoad(sender:VarsLoad):Void {
    trace(this.myVarsLoad.getValue("city"));
}

var myVarsLoad:VarsLoad = new VarsLoad("http://example.com/getData.php");
myVarsLoad.addEventObserver(this, VarsLoad.EVENT_LOAD_COMPLETE, "onVarsLoad");
myVarsLoad.setValue("zip", "94109");
myVarsLoad.setValue("state", "CA");
myVarsLoad.start();

Summary

Constructor
Class properties
Class properties inherited from DataLoad
Class properties inherited from RetryableLoad
Instance properties
Instance properties inherited from DataLoad
Instance properties inherited from RetryableLoad
Instance properties inherited from Load
Instance properties inherited from EventDispatcher
Instance properties inherited from CoreObject

Constructor

VarsLoad

function VarsLoad (path:String, method:String)
Defines file and location of load triggered by start.
Parameters:
path :
The absolute or relative URL of the variables to be loaded.
method:
[optional] Defines the method of the HTTP protocol, either "GET" of "POST"; defaults to "POST".

Instance methods

getLoadVars

function getLoadVars () : LoadVars
Gets the LoadVars object defined by the loaded variables, if loaded; or the the LoadVars object populated by setValue, if not loaded.
Returns:
Returns the LoadVars object.

getValue

function getValue (name:String) : String
Gets the value of a name-value pair defined by loaded variables, if any; or defined by setValue.
Parameters:
name:
The name of the variable.
Returns:
The value of the variable.

setValue

function setValue (name:String, value:String) : Void
Sets a name-value pair to send to the server side script.
Parameters:
name :
The name of the variable.
value:
The value of the variable.