Object | +-LoadVars public dynamic class LoadVars extends Object
You can use the LoadVars class to obtain verification of successful data loading and to monitor download progress. The LoadVars class is an alternative to the loadVariables() function for transferring variables between a Flash application and a server.
The LoadVars class lets you send all the variables in an object to a specified URL and load all the variables at a specified URL into an object. It also lets you send specific variables, rather than all the variables, which can make your application more efficient. You can use the LoadVars.onLoad handler to ensure that your application runs when data is loaded, and not before.
The LoadVars class works much like the XML class; it uses the methods load(), send(), and sendAndLoad() to communicate with a server. The main difference between the LoadVars class and the XML class is that LoadVars transfers ActionScript name and value pairs, rather than an XML DOM tree stored in the XML object. The LoadVars class follows the same security restrictions as the XML class.
loadVariables function, onLoad (LoadVars.onLoad handler), hasXMLSocket (capabilities.hasXMLSocket property)
|
Modifiers |
Property |
Description |
|---|---|---|
|
|
The MIME type that is sent to the server when you call LoadVars.send() or LoadVars.sendAndLoad(). |
|
|
|
A Boolean value that indicates whether a load or sendAndLoad operation has completed, undefined by default. |
Properties inherited from class Object
|
constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property) |
|
Event |
Description |
|---|---|
|
Invoked when data has completely downloaded from the server or when an error occurs while data is downloading from a server. |
|
|
Invoked when a LoadVars.load() or LoadVars.sendAndLoad() operation has ended. |
|
Signature |
Description |
|---|---|
|
LoadVars() |
Creates a LoadVars object. |
|
Modifiers |
Signature |
Description |
|---|---|---|
|
|
addRequestHeader(header:Object, headerValue:String) : Void |
Adds or changes HTTP request headers (such as Content-Type or SOAPAction) sent with POST actions. |
|
|
Converts the variable string to properties of the specified LoadVars object. |
|
|
|
getBytesLoaded() : Number |
Returns the number of bytes downloaded by LoadVars.load() or LoadVars.sendAndLoad(). |
|
|
getBytesTotal() : Number |
Returns the total number of bytes downloaded by LoadVars.load() or LoadVars.sendAndLoad(). |
|
|
Downloads variables from the specified URL, parses the variable data, and places the resulting variables into my_lv. |
|
|
|
Sends the variables in the my_lv object to the specified URL. |
|
|
|
sendAndLoad(url:String, target:Object, [method:String]) : Boolean |
Posts variables in the my_lv object to the specified URL. |
|
|
Returns a string containing all enumerable variables in my_lv, in the MIME content encoding application/x-www-form-urlencoded. |
Methods inherited from class Object