Jumping to a different URL

To open a Web page in a browser window, or to pass data to another application at a defined URL, you can use the getURL action. For example, you can have a button that links to a new Web site, or you can send data to a CGI script for processing in the same way as you would an HTML form.

In the following procedure, the requested file must be at the specified location and absolute URLs must have a network connection (for example, http://www.myserver.com/).

For information on passing variables, see "Connecting with External Sources" in Using Flash.

To jump to a URL:

  1. Select the frame, button instance, or movie clip instance to which you will assign the action.
  2. Choose Window > Actions to display the Actions panel if it's not already visible. If the Actions panel is not in normal mode, choose Normal Mode from the View Options pop-up menu.
  3. In the Actions toolbox, click the Actions category, then click the Browser/Network category, and double-click the getURL action.
  4. In the parameters pane, enter the URL from which to get the document or to which you are sending data, following these guidelines:
  5. A relative path lets you describe one file's location in relation to another; it tells Flash to move up and down the hierarchy of nested files and folders, starting from the file where you issued the getURL instruction. An absolute path is the complete address that specifies the name of the server on which the file resides, the path (the nested hierarchy of directories, volumes, folders, and so on), and the name of the file itself.For more information about writing paths, see "About absolute and relative target paths" in Using Flash.

    For example, the following statement indicates that the URL is the value of the variable dynamicURL:

    getURL(dynamicURL);
    

    For information on writing expressions, see Using operators to manipulate values in expressions.

  6. For Window, specify the window or HTML frame into which the document will be loaded, as follows.
  7. _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.

  8. For Variable, choose a method for sending variables for the loaded movie to the location listed in the URL text box:
  9. Your code would look similar to the following line:

    getUrl ("page2.html", "blank");
    

    The getURL action loads the HTML file page2.html into a new browser window.

For more information on the getURL action, see its entry in the online ActionScript Dictionary in the Help menu.