Assigning Links in Flash

To add some interactivity to the flash animated part of your web design template you should add some links to the flash objects. For example youll need to link flash buttons with pages of your website or redirect your flash intro to homepage after it finished.

There are some kinds of links in Macromedia Flash: button symbol links, frame links and text links.

First of all you should open source FLA file in Macromedia Flash editor, see instructions about it in Opening Your FLA File section.

To add links to the button symbols in your flash movie do the following. First of all you should locate button symbol you want links be assigned to. There are two ways of how to do that.

The first way is to access it from the timeline. After youve opened FLA file in Macromedia Flash, move red timeline slider and watch the animation process. When youll see button symbol that needs to be linked, stop the timeline slider.

Select it by single clicking it with Selection Tool . You can choose Selection Tool from tools panel or call this tool by pressing V hotkey. Go to the Properties Panel to check this symbols behavior. If you cant see this panel for any reason you can open it by pressing Ctrl + F3 hotkey. At the top left corner of this panel symbols behavior dropdown is located. It must be a Button. If it is Movie Clip, Graphics or some other that differs from Button you cant assign links to it in the right way. Dont change it to the Button because it will damage original rollover structure. Double click this symbol to get inside of it, select its content and check symbols behavior again.

Fig 9.5 Symbol Behavior

If you are still unable to locate appropriate symbol, maybe some symbols are hidden or locked. To unhide/unlock symbols do the following. Go to timeline panel, there is a layers list at the left of it. There are three icons at the top of this list: eye, lock and rectangle. Click eye and lock icons twice to unhide and unlock all layers in current symbol.

Some of flash headers have complicated structure to create powerful animation effects. So it will be hard to access button symbols from the timeline. The easiest and most reliable way to locate elements in flash is to use symbols library. To open symbols library you can use Ctrl + L hotkey or choose Window/Library from the top menu.

Browse the symbols library to find button symbol you want links be assigned to. You can see symbols preview in the preview window at the top of symbols library panel. Actually all button symbols have appropriate names such as About Us button or Search button. Double click symbols icon to edit it in the main workspace window. Then do operations described above to locate symbol with Button behavior.

After youve selected button symbol press F9 to open Actions panel. If this button has rollover effect, you will see following script code there:

 

on (rollOver) {

          gotoAndPlay(2);

}

on (rollOut) {

          gotoAndPlay(10);

}

Add there following getURL action script code:

on (release) {

          getURL("your_url_here");

}

Fig 9.6 GetURL Action Script

You should type URL button will be linked to as getURL function argument. For example if you want to link button to your contacts page type following:

on (release) {

          getURL("https://mywebsite.com/contacts.html");

}

Actually getURL function accepts three arguments: URL, window type and variables send method. Window type argument specifies were new URL will be opened. If this argument is blank link will be open in same window. If you wan to open it in a new window, use _blank argument. Variables send method should be used if you are parsing some variables through URL string. Available options are GET and POST. Next action script example calls products page with item variable with 9 value in the same window using GET method.

on (release) {

           getURL("https://mywebsite.com/products.php?item=9", "_self", "GET");

}

If you are using flash intro template, you will need to redirect visitor to your website after intro finished playing. To do these follow next instructions.

Move red timeline slider to the end of flash intro movie. Select the last frame by single clicking it with mouse. Press F6 to create keyframe in this frame. Press F9 to open Actions panel. Type the following code there.

getURL("your_url_here");

Replace your_url_here text with appropriate URL of your website.

If you want some portion of text to be linked to some location on web do the following. Locate symbol containing text using instructions from Changing Text in Flash section. Select text you want to link with URL using Text Tool. Go to Properties Panel, press Ctrl+F3 if you cant see it for some reasons. At the very bottom of that panel youll see URL input box. It have chain icon at the left of it. Just fill that empty input box with appropriate URL.

Fig 9.7 URL Input Box

Now its time to publish your flash movie. Read Publishing Your Flash Movie section for detailed instructions.