10. Adding Links



In Flash you can add links to text directly like in a html editor or you can add links through buttons and Actionscript.

Open the file index.fla from template/flash.

Go to the Library and double click the "copy" movie clip to edit it:

Now go to Layer 1 and select the copyright text. Use the Text tool to edit it. Select "Your Company Name" text and look at the Properties palette:

In the marked area you can write a link to the desired file...and you have a link!

This method is less used because we generally use invisible buttons to set links (to frames, files etc.).

Now go to Layer 2. Here we have a text and an invisible button to set a link. Click on the invisible button and look at the Action palette:

As you can see we have an "on (release)" action that triggers the getURL actions. This action sets a link to an external web site that will open in new browser window. This the most common way to set a link.

Note that in Flash we have links to frames, scenes symbols etc. (for example gotoAndPlay(2) ) and links to html pages, web sites (for example getURL ("home.html"), _blank) ).

In our buttons we have a link to an external movie that will load over the main movie. Go to Library and double click the "home" movie clip to edit it. Then select the invisible button inside this movie clip to display the Actionscript associated with it. Look at the Actions palette:

When we release the mouse button we call the "home.swf" movie to load over the main window, that means in the "level 1". This is just another way to set links in Flash.