User Guide
MovieClip 873
method:String [optional] - A String (either "GET" or "POST") that specifies a method for
sending variables associated with the SWF file to load. If no variables are present, omit this
parameter; otherwise, specify whether to load variables using a
GET or POST method. GET
appends the variables to the end of the URL and is used for a small number of variables.
POST
sends the variables in a separate HTTP header and is used for long strings of variables.
Example
The following ActionScript creates a movie clip instance and opens the Macromedia website
in a new browser window:
this.createEmptyMovieClip("loader_mc", this.getNextHighestDepth());
loader_mc.getURL("http://www.macromedia.com", "_blank");
The getURL() method also allows you to send variables to a remote server-side script, as seen
in the following code:
this.createEmptyMovieClip("loader_mc", this.getNextHighestDepth());
loader_mc.username = "some user input";
loader_mc.password = "random string";
loader_mc.getURL("http://www.flash-mx.com/mm/viewscope.cfm", "_blank",
"GET");
The MovieClip.getNextHighestDepth() method used in these examples requires Flash
Player 7 or later. If your SWF file includes a version 2 component, use the version 2
components DepthManager class instead of the
MovieClip.getNextHighestDepth()
method.
When using this method, consider the Flash Player security model.
■ For Flash Player 8, MovieClip.getURL() is not allowed if the calling SWF file is in the
local-with-file-system sandbox and the resource is nonlocal.
For more information, see the following:
■ Chapter 17, "Understanding Security," in Learning ActionScript 2.0 in Flash
■ The Flash Player 8 Security white paper at http://www.macromedia.com/go/fp8_security
■ The Flash Player 8 Security-Related API white paper at http://www.macromedia.com/go/
fp8_security_apis
See also
getURL function, sendAndLoad (LoadVars.sendAndLoad method), send
(LoadVars.send method)