
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
61
Example
The following example creates a LoadVars object and displays the default content type of the data that is sent to the
server:
application.onConnect = function(client){
this.acceptConnection(client);
var my_lv = new LoadVars();
trace(my_lv.contentType);
};
// Output to Live Log: application/x-www-form-urlencoded
LoadVars.decode()
myLoadVars.decode(queryString)
Converts the query 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.
Availability
Flash Media Server 2
Parameters
queryString A URL-encoded query string containing name-value pairs.
Example
The following example traces the three variables:
application.onConnect = function(client){
this.acceptConnection(client);
// Create a new LoadVars object.
var my_lv = 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]);
}
};
The following is output to the Live Log panel in the Administration Console:
name=Mort&score=250000
name -> Mort
score -> 250000
contentType -> application/x-www-form-urlencoded
loaded -> false
LoadVars.getBytesLoaded()
myLoadVars.getByesLoaded()
Returns the number of bytes loaded from the last or current LoadVars.load() or LoadVars.sendAndLoad()
method call. The value of the
contentType property does not affect the value of getBytesLoaded().
Commenti su questo manuale