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.

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 leftmost component of a file's URL. For example, a SWF file at<br />

www.someDomain.com can load data from a source 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, url must be in exactly the same<br />

domain as the SWF file that is issuing this call (see "Flash Player security features" in Using<br />

ActionScript in Flash). For example, a SWF file at www.someDomain.com can load data only<br />

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

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

information, see "About allowing cross-domain data loading" in Using ActionScript in Flash.<br />

If you want to load variables into a target MovieClip, use loadVariables() instead of<br />

loadVariablesNum().<br />

Parameters<br />

url:String - An absolute or relative URL where the variables are located. 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 />

level:Number - An integer specifying the level in Flash Player to receive the variables.<br />

method:String [optional] - Specifies an HTTP method for sending variables. The parameter<br />

must be the string GET or POST . If there are no variables to be sent, omit this parameter. The<br />

GET method appends the variables to the end of the URL <strong>and</strong> is used for small numbers of<br />

variables. The POST method sends the variables in a separate HTTP header <strong>and</strong> is used for<br />

long strings of variables.<br />

Example<br />

The following example loads information from a text file called params.txt into the main<br />

Timeline of the SWF at level 2 in Flash Player. The variable names of the text fields must<br />

match the variable names in the params.txt file. The setInterval() function is used to<br />

check the progress of the data being loaded into the SWF. The script checks for a variable in<br />

the params.txt file named done.<br />

loadVariablesNum("params.txt", 2);<br />

function checkParamsLoaded() {<br />

if (_level2.done == undefined) {<br />

trace("not yet.");<br />

} else {<br />

trace("finished loading. killing interval.");<br />

trace("-------------");<br />

for (i in _level2) {<br />

60 ActionScript language elements

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

Saved successfully!

Ooh no, something went wrong!