03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - 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.

Downloads variables from the specified URL, parses the variable data, <strong>and</strong> places the resulting<br />

variables into my_lv. Any properties in my_lv with the same names as downloaded variables<br />

are overwritten. Any properties in my_lv with different names than downloaded variables are<br />

not deleted. This is an asynchronous action.<br />

The downloaded data must be in the MIME content type application/x-www-form-urlencoded.<br />

This is the same format used by loadVariables().<br />

In SWF files running in a version of the player earlier than Flash Player 7, url must be in the<br />

same superdomain as the SWF file that is issuing this call. A superdomain is derived by<br />

removing the left-most component of a file's URL. For example, a SWF file at<br />

www.someDomain.com can load data from sources at store.someDomain.com because both<br />

files are in the same superdomain named someDomain.com.<br />

In SWF files of any version running in Flash Player 7 or later, url must be in exactly the same<br />

domain. For example, a SWF file at www.someDomain.com can load data only from sources<br />

that are also at www.someDomain.com. If you want to load data from a different domain, you<br />

can place a cross-domain policy file on the server hosting the SWF file.<br />

Also, in files published for Flash Player 7, case-sensitivity is supported for external variables<br />

loaded with LoadVars.load().<br />

This method is similar to XML.load().<br />

Parameters<br />

url:String - A string; the URL from which to download the variables. If the SWF file<br />

issuing this call is running in a web browser, url must be in the same domain as the SWF file;<br />

for details, see the Description section.<br />

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 />

LoadVars 369

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

Saved successfully!

Ooh no, something went wrong!