Sometime or another, you are
going to be linking your Flash animation to another page
through your Web browser. In Flash, only buttons can be used
to link to another page when the user clicks the mouse. This
tutorial will teach you how to link to another page and the
various window states that can be used.
Click the button to see what
you will have created by the end of this tutorial:
Creating And Making The
First, download the partial
FLA for this tutorial by
clicking here. The partial FLA only includes the
button with no actual coding. You will add the small portion
of code yourself!
Once you have opened the
partial FLA, right click on the button and select Actions.
Next, click the plus sign ( + ) and select Basic Actions |
Once you select
Get URL, you will see the current Object Actions window
display the various fields for creating and modifying a
URL (Uniform Resource Locator).
In the URL field, enter the address http://www.yahoo.com.
When the button is clicked, it will take the visitor to
Yahoo's home page.
Publish the animation and preview it in your browser
(File | Publish Preview | HTML). Once the button is
clicked, Yahoo's home page will load in the current
Opening in a Separate Browser
Window When the button was clicked, Yahoo loaded
in your current browser window. Most of the time, you would
rather have people stay on your site while visiting another
site at the same time. To accomplish that, many sites open
links pointing to pages outside of their site in a separate
browser window. You too can do that to your animation.
Right click on the button and
select Actions. You will see the Object Actions window.
Select the second line of code that says "getURL". The URL
fields will be displayed again. Click the Window drop-down
menu and select _blank. The _blank setting
will allow the link (URL) you specified to open in a new
Below you will find an
explanation about each selection in Window drop-down menu:
Loads the link in the current page or the current page in
a Frame. This is the default selection used by Flash to
open any link.
Loads the link in a separate browser window. You selected
_blank in the tutorial above.
Loads the link into the frameset file of a frame. The
frameset file controls all the frames, and setting the
window to _parent will eliminate frames in the subsequent
links. As you may have seen, often times, links get loaded
inside frames unintentionally. Setting _parent will solve
the misuse of frames!
Loads the link on the top frame.
To see how my FLA looks like
compared to yours, download my FLA by clicking
here. Also, if you are interested in making a new window
open without having to display the browser buttons, address
tutorial by clicking the following link:
If you have questions, need some assistance on this topic, or just want to
chat - post in the comments below or drop by our friendly forums
(where you have a lot more formatting options) and post your question. There are
a lot of knowledgeable and witty people who would be happy to help you out
Did you enjoy reading this and found it useful? If so, please share it with
If you didn't like it, I always like to hear how I can do better next time.
Please feel free to contact me directly via e-mail, facebook, or twitter.
I like to talk a lot - A WHOLE LOT. When I'm not talking, I've been known to write the occasional English word. You can learn more about me by going here.