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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

method:String [optional] - A String (either "GET" or "POST") that specifies a method for<br />

sending variables associated with the SWF file to load. If no variables are present, omit this<br />

parameter; otherwise, specify whether to load variables using a GET or POST method. GET<br />

appends the variables to the end of the URL <strong>and</strong> is used for a small number of variables. POST<br />

sends the variables in a separate HTTP header <strong>and</strong> is used for long strings of variables.<br />

Example<br />

The following <strong>ActionScript</strong> creates a movie clip instance <strong>and</strong> opens the <strong>Adobe</strong> website in a<br />

new browser window:<br />

this.createEmptyMovieClip("loader_mc", this.getNextHighestDepth());<br />

loader_mc.getURL("http://www.adobe.com", "_blank");<br />

The getURL() method also allows you to send variables to a remote server-side script, as seen<br />

in the following code:<br />

this.createEmptyMovieClip("loader_mc", this.getNextHighestDepth());<br />

loader_mc.username = "some user input";<br />

loader_mc.password = "r<strong>and</strong>om string";<br />

loader_mc.getURL("http://www.flash-mx.com/mm/viewscope.cfm", "_blank",<br />

"GET");<br />

The MovieClip.getNextHighestDepth() method used in these examples requires Flash<br />

Player 7 or later. If your SWF file includes a version 2 component, use the version 2<br />

components' DepthManager class instead of the MovieClip.getNextHighestDepth()<br />

method.<br />

When using this method, consider the Flash Player security model.<br />

■ For Flash Player 8, MovieClip.getURL() is not allowed if the calling SWF file is in the<br />

local-with-file-system s<strong>and</strong>box <strong>and</strong> the resource is nonlocal.<br />

For more information, see the following:<br />

■ "Underst<strong>and</strong>ing Security" in Learning <strong>ActionScript</strong> <strong>2.0</strong> in Flash<br />

■ The Flash Player 9 Security white paper at http://www.adobe.com/go/fp9_0_security<br />

■ The Flash Player 8 Security-Related API white paper at http://www.adobe.com/go/<br />

fp8_security_apis<br />

See also<br />

getURL function, sendAndLoad (LoadVars.sendAndLoad method), send<br />

(LoadVars.send method)<br />

globalToLocal (MovieClip.globalToLocal method)<br />

public globalToLocal(pt:Object) : Void<br />

MovieClip 885

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

Saved successfully!

Ooh no, something went wrong!