Contenttype (Loadvars.contenttype Property); Decode (Loadvars.decode Method) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

contentType (LoadVars.contentType property)

public contentType :
String
The MIME type that is sent to the server when you call
or
LoadVars.send()
. The default is application/x-www-form-urlencoded.
LoadVars.sendAndLoad()
Availability: ActionScript 1.0; Flash Lite 2.0
Example
The following example creates a LoadVars object and displays the default content type of the
data that is sent to the server.
var my_lv:LoadVars = new LoadVars();
trace(my_lv.contentType); // output: application/x-www-form-urlencoded
See also
,
send (LoadVars.send method)
sendAndLoad (LoadVars.sendAndLoad method)

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
event handler. Most users do not
LoadVars.onData
need to call this method directly. If you override the
event handler, you
LoadVars.onData
can explicitly call
to parse a string of variables.
LoadVars.decode()
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
- A URL-encoded query string containing name/value pairs.
queryString:String
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]);
}
394
ActionScript classes

Advertisement

Table of Contents
loading

Table of Contents