03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Returns<br />

Boolean - false if no parameter (null) is passed; true otherwise. Use the onLoad() event<br />

h<strong>and</strong>ler to check the success of loaded data.<br />

Example<br />

The following code defines an onLoad h<strong>and</strong>ler function that signals when data is returned to<br />

the Flash application from a server-side PHP script, <strong>and</strong> then loads the data in passvars.php.<br />

var my_lv:LoadVars = new LoadVars();<br />

my_lv.onLoad = function(success:Boolean) {<br />

if (success) {<br />

trace(this.toString());<br />

} else {<br />

trace("Error loading/parsing LoadVars.");<br />

}<br />

};<br />

my_lv.load("http://www.helpexamples.com/flash/params.txt");<br />

For another example, see the Flash Samples page at www.adobe.com/go/learn_fl_samples.<br />

Download <strong>and</strong> decompress the Samples zip file <strong>and</strong> go to the<br />

<strong>ActionScript</strong><strong>2.0</strong>\DataIntegration\Guestbook folder to access the guestbook.fla file.<br />

See also<br />

load (XML.load method), loaded (LoadVars.loaded property), onLoad<br />

(LoadVars.onLoad h<strong>and</strong>ler), useCodepage (System.useCodepage property)<br />

loaded (LoadVars.loaded property)<br />

public loaded : Boolean<br />

A Boolean value that indicates whether a load or sendAndLoad operation has completed,<br />

undefined by default. When a LoadVars.load() or LoadVars.sendAndLoad() operation is<br />

started, the loaded property is set to false; when the operation completes, the loaded<br />

property is set to true. If the operation has not completed or has failed with an error, the<br />

loaded property remains set to false.<br />

This property is similar to the XML.loadedproperty.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 6<br />

Example<br />

The following example loads a text file <strong>and</strong> displays information in the Output panel when<br />

the operation completes.<br />

LoadVars 711

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!