How to Create Hyperlinks in Flash Movies

How to Create Hyperlinks in Flash Movies thumbnail
Hyperlinks in Flash Movies

One of the best ways to add interactivity to flash movies is to add links to them. ActionScript is used to provide this sort of animation. Linking in flash can be done in only two ways, by linking to another page using the Properties panel located on the bottom section of stage, or by use of ActionScript. The latter method offers more flexibility once the basics are mastered. Only a few lines of ActionScript are needed to create powerful active hyperlinks.

Instructions

  1. Button Hyperlink

    • 1

      Load your flash application.

    • 2

      Create a new layer and name it "Button." To create a new layer, go to the left side of the timeline and right click. Select "New Layer" on the drop-down menu.

    • 3

      Create a button instance on the "Button" layer on the page. Ensure it is a button instance since we want it to be clickable.

    • 4

      Type the "Instance Name" of the button on the Properties panel below the timeline. Use the text box below the "Button" drop-down menu labeled "<Instance Name>" to type it in.

    • 5

      Add button states by double clicking on the button instance and changing the "Up," "Over," "Down" and "Hit" states.

    • 6

      Double click outside the button instance to go back to the main window view.

    • 7

      Select the button instance on stage and press F9.

    • 8

      Copy and past the following code on the displayed window:

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

      This opens the URL http://www.ehow.com in a new browser window once the button is clicked. You can change the URL to whatever you want. The "_blank" parameter is optional.

    • 9

      Test your movie bypressing "Ctrl + Enter."

    Frame Hyperlink

    • 10

      Create a new layer and name it "Button" as explained in the steps above.

    • 11

      Create a new button instance as explained in the steps above.

    • 12

      Create a new layer and name it "Actions." This is where all the ActionScript code will go.

    • 13

      Click on the first frame of the "Actions" layer and press F9.

    • 14

      Type the following code:

      eHow.btn.onRelease = function () {
      getURL (http://eHow.com);
      }

    • 15

      Test your movie by pressing "Ctrl + Enter."

Tips & Warnings

  • The syntax for naming buttons should end with the "_btn" as shown above. This allows for the flash application to offer code hints associated with button instances. The same applies for movie instances ("_mc").

  • The URL can be a page relative to the flash movie, that is, it can be something like "flash.htm."

  • Window parameters that can be used include "_blank", "_self", "_new", "_top" and "_parent".

Related Searches:

References

Resources

  • Photo Credit old movie film onwhite background image by Anatoly Tiplyashin from Fotolia.com

Comments

You May Also Like

Related Ads

Featured