Browser windows and framesets with getURL
The getURL action loads a document from a specific URL into a window or HTML frame. For Macromedia Flash movies included in an HTML frameset, you may want to specify the window or frame you want the URL to load into. The Window argument to getURL allows you to specify this window or frame. The illustration below shows the Action panel options forgetURL.
|
The Window parameter
The Window pop-up menu contains four standard, predefined target options: _self, _blank, _parent and _top. You can optionally enter a specific window or frame name, as defined by an HTML frameset. The table below explains the various Window options and their results.
Window target options:
| Option | Result |
| _self | Loads the specified URL in the same window or frame containing the Flash movie. This is the default value, if none is specified. |
| _blank | Launches a new browser window and loads the specified URL into it, keeping the original window available. |
| _parent | Loads the specified URL into the parent frameset of the frame containing the Flash movie. |
| _top | Loads the URL into the outermost frameset of the current HTML document. |
| specific name | Loads the URL into the specified frame or window, as defined in an HTML frameset. Note: If the specified frame or window doesn't exist, the URL will open in a new browser window. |
An frameset example
The image below represents an HTML frameset consisting of two "nested" framesets. The main document (main.html) defines a frameset containing a left and a right frame, named "left" and "right", respectively. The HTML source for the right frame (right.htm) itself defines an frameset containing a top and a bottom frame, named "upper" and "lower", respectively. The diagrams below represent the structure of the frameset and the frames:
|
|
The source code that defines the frame name for each frame in the frameset would look similar to this:
main.html
<FRAMESET>
<FRAME NAME="left" SRC="left.html">
<FRAMENAME="right"SRC="right.html">
</FRAMESET>
right.html
<FRAMESET>
<FRAME NAME="upper" SRC="upper.html">
<FRAMENAME="lower"SRC="lower.html">
</FRAMESET>
The frameset example demonstrates how the various getURL frame and window targetswork in this frameset.
Note: To open the target URL in a new default size browser window enter '_blank in the Window field. In this case the browser controls the size and attributes of the new window. If more precise control over the window's size, menus, etc. is required consider the techniques in How to create pop-up browser windows in Flash (TechNote 14192).
Additional information
Important target information
When indicating a specific FRAMESET name in the Target Window, it is important that the frame name entered into the Target Window field is identical to the spelling and capitalization of the FRAMESET name. Consider the following frame declaration:
<FRAMENAME="lower"SRC="lower.html">
To target this frame in a getURL action, be sure to use proper spelling and capitalization.
| OK | Not OK | Not OK | Not OK |
| lower | "lower" | _lower | loWeR |
The URL field
You can enter absolute URLs (http://www.macromedia.com/index.htm), or a relative URL, ( index.htm) in the getURL action's URL field.
If you wish to use relative URLs, thenit is a good idea to use the BASE attribute in your OBJECT and EMBED tags. To learn more about the BASE attribute, see Using relative URLs with Get URL action (TechNote 4157).
The Variable field
You can select POST or GET HTTP method.
Creating"pop-up" browser windows
For information on how to use JavaScript to control the attributes of a pop-up window see How to create pop-up browser windows in Flash (TechNote 14192.)
Troubleshooting
If you're getting unexpected results when targeting windows or frames, then try one of the following troubleshooting techniques to help isolate the problem.
- Use _self or _blank as the Window target to get a known result.
- In the URL field, use an absolute URL that is known to be good, such as http://www.macromedia.com
- If you are assigning the getURL action to a button, place the button in a new, one frame movie.
- If targeting a specific frame name, make sure that the frame name Window target field exactly matches the frame name within the FRAMESET tag (see above for more details).
This content requires Flash
To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.
Download the free Flash Player now!
