User Guide
322 Chapter 6: ActionScript Core Classes
var my_lv:LoadVars = new LoadVars();
my_lv.onLoad = function(success:Boolean) {
if (success) {
trace(this.toString());
} else {
trace("Error loading/parsing LoadVars.");
}
};
my_lv.load("http://www.flash-mx.com/mm/params.txt");
For an in-depth example, see “Using the LoadVars class” on page 69 and the Macromedia DevNet
article “Macromedia Flash MX and PHP” at www.macromedia.com/devnet/mx/flash/articles/
flashmx_php.html.
LoadVars.loaded
LoadVars.loaded
Availability
Flash Player 6.
Usage
my_lv.loaded:Boolean
Description
Property; a Boolean value that indicates whether a load or sendAndLoad operation has
completed, undefined by default. When a
LoadVars.load() or LoadVars.sendAndLoad()
operation is started, the
loaded property is set to false; when the operation completes, the
loaded property is set to true. If the operation has not completed or has failed with an error, the
loaded property remains set to false.
This property is similar to the
XML.loaded property.
Example
The following example loads a text file and writes information to the log file when the operation
completes.
var my_lv:LoadVars = new LoadVars();
my_lv.onLoad = function(success:Boolean) {
trace("LoadVars loaded successfully: "+this.loaded);
};
my_lv.load("http://flash-mx.com/mm/params.txt");