Flash Lite 2.x and 3.0 ActionScript Language Reference

decode (LoadVars.decode method)

public decode(queryString:String) : Void

Converts the variable string to properties of the specified LoadVars object.

This method is used internally by the LoadVars.onData event handler. Most users do not need to call this method directly. If you override the LoadVars.onData event handler, you can explicitly call LoadVars.decode() to parse a string of variables.

Parameters

queryString:String - A URL-encoded query string containing name/value pairs.

Example

The following example traces the three variables:

// Create a new LoadVars object
var my_lv:LoadVars = new LoadVars();
//Convert the variable string to properties
my_lv.decode("name=Mort&score=250000");
trace(my_lv.toString());
// Iterate over properties in my_lv
for (var prop in my_lv) {
    trace(prop+" -> "+my_lv[prop]);
}

See also

onData (LoadVars.onData handler), parseXML (XML.parseXML method)