VarsLoad

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

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

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

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

Summary

Constructor
Class properties
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

getValue

function getValue (
name:String) : String
Gets the value of a name-value pair set either by setValue or defined by loaded variables.
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.