Home : Adobe : Flash : Basics : Navigation : Links

How to Make Hyperlinks in Flash

Text Hyperlinks

Flash Hyperlink field

If you have a text box, you can create a hyperlink by simply selecting the box and entering the link URL in the hyperlink field (pictured right).

Button Hyperlinks

You can turn any button (or movieclip) instance into a hyperlink. If you don't already have a button on the stage, do this first:

  1. Add or create an image on the stage that will become the button.
  2. Select the image then from the menu select Modify > Convert to Symbol (F8).
  3. In the symbol dialogue, set the Type to Button.

The next step will depend on whether you are using Actionscript 2 or 3 (if you don't know, look in File > Publish Settings under the Flash tab).

Actionscript 2

Select the button instance on the stage and open the Actions panel (you can right-click the button and select Actions). Enter the following code into the actions panel:

on(release)
{
getURL("http://www.example.com", "_blank");
}

Actionscript 3

First, give the button an instance name by selecting it and entering a name in the Instance field of the property inspector. For this example will will use the name myButton_btn.

In the main timeline enter the following code:

myButton_btn.addEventListener(MouseEvent.CLICK, myButtonFunction);
function myButtonFunction(event: MouseEvent) {
var request:URLRequest = new URLRequest("http://www.example.com");
navigateToURL(request, "_blank");
}

Notes: