User Guide
60 ActionScript language elements
Parameters
url:String - The URL from which to obtain the document.
window:String [optional] - Specifies the window or HTML frame into which the document
should load. You can enter the name of a specific window or select from the following
reserved target names:
■ _self specifies the current frame in the current window.
■ _blank specifies a new window.
■ _parent specifies the parent of the current frame.
■ _top specifies the top-level frame in the current window.
method:String [optional] - A GET or POST method for sending variables. If there are no
variables, omit this parameter. The
GET method appends the variables to the end of the URL,
and is used for small numbers of variables. The
POST method sends the variables in a separate
HTTP header and is used for sending long strings of variables.
Example
This example loads an image into a movie clip. When the image is clicked, a new URL is
loaded in a new browser window.
var listenerObject:Object = new Object();
listenerObject.onLoadInit = function(target_mc:MovieClip) {
target_mc.onRelease = function() {
getURL("http://www.macromedia.com/software/flash/flashpro/", "_blank");
};
};
var logo:MovieClipLoader = new MovieClipLoader();
logo.addListener(listenerObject);
logo.loadClip("http://www.helpexamples.com/flash/images/image1.jpg",
this.createEmptyMovieClip("macromedia_mc", this.getNextHighestDepth()));
In the following example, getURL() is used to send an e-mail message:
myBtn_btn.onRelease = function(){
getURL("mailto:you@somedomain.com");
};
In the following ActionScript, JavaScript is used to open an alert window when the SWF file
is embedded in a browser window (please note that when calling JavaScript with getURL(),
the url parameter is limited to 508 characters):
myBtn_btn.onRelease = function(){
getURL("javascript:alert('you clicked me')");
};