398
ActionScript classes
Parameters
url
:
String
- A string; the URL from which to download the variables. If the SWF file
issuing this call is running in a web browser,
url
must be in the same domain as the SWF file;
for details, see the Description section.
Returns
Boolean
-
false
if no parameter (null) is passed;
true
otherwise. Use the
onLoad()
event
handler to check the success of loaded data.
Example
The following code defines an
onLoad
handler function that signals when data is returned to
the Flash application from a server-side PHP script, and then loads the data in passvars.php.
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.helpexamples.com/flash/params.txt");
An example is also in the guestbook.fla file in the ActionScript samples folder. The following
list gives typical paths to this folder:
■
Windows:
boot drive
\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\ActionScript
■
Macintosh:
Macintosh HD
/Applications/Macromedia Flash 8/Samples and Tutorials/
Samples/ActionScript
See also
load (XML.load method)
,
loaded (LoadVars.loaded property)
,
onLoad
(LoadVars.onLoad handler)
Summary of Contents for Flash Lite 2
Page 1: ...Flash Lite 2 x ActionScript Language Reference...
Page 22: ...22 Contents...
Page 244: ...244 ActionScript language elements...
Page 760: ...760 ActionScript classes...