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.

For an example, see the XML_blogTracker.fla <strong>and</strong> XML_languagePicker.fla files in the<br />

ActionScript samples folder at www.adobe.com/go/learn_fl_samples. Download <strong>and</strong><br />

decompress the .zip file <strong>and</strong> navigate to the folder for your version of ActionScript to access<br />

the sample.<br />

load (XML.load method)<br />

public load(url:String) : Boolean<br />

Loads an XML document from the specified URL, <strong>and</strong> replaces the contents of the specified<br />

XML object with the downloaded XML data. The URL is relative <strong>and</strong> is called using HTTP.<br />

The load process is asynchronous; it does not finish immediately after the load() method is<br />

executed.<br />

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

must be in the same superdomain as the SWF file that issues this call. A superdomain is<br />

derived by removing the leftmost 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 of someDomain.com.<br />

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

exactly the same domain. For example, a SWF file at www.someDomain.com can load data<br />

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

different domain, you can place a cross-domain policy file on the server that is hosting the SWF<br />

file.<br />

When the load() method is executed, the XML object property loaded is set to false.<br />

When the XML data finishes downloading, the loaded property is set to true, <strong>and</strong> the<br />

onLoad event h<strong>and</strong>ler is invoked. The XML data is not parsed until it is completely<br />

downloaded. If the XML object previously contained any XML trees, they are discarded.<br />

You can define a custom function that executes when the onLoad event h<strong>and</strong>ler of the XML<br />

object is invoked.<br />

Parameters<br />

url:String - A string that represents the URL where the XML document to be loaded is<br />

located. If the SWF file that issues this call is running in a web browser, url must be in the<br />

same domain as the SWF file; 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 a loaded XML document.<br />

686 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!