Loading a URL

Loading a URL when a user clicks on a button is a relatively easy click action to understand and implement. Even web designers who use a program such as Macromedia Dreamweaver or Microsoft FrontPage usually know how to enter a standard href HTML tag that sets a link to load a URL. Setting the Drop Down Menu component is, therefore, very intuitive. Let's look at a few examples.

If you have the Click Action Parameters screen still open, click Close and then follow these steps:

  1. Select Item 5 in the Menu Items parameter, and once again Help should appear in the text field. Change the text to Links.

  2. Select Item 1 in the Sub Item For Main Item #5 parameter. Change the text to Flash Foundry.

  3. Click the Edit Click Action button. Notice that the action previously assigned to this button has remained the same even though we changed the text for the button.

  4. Click the downward-pointing arrow to the right of the list field in the Action parameter and select Load URL from the list (see Figure 5.11).


    Figure 5.11: Selecting Load URL from the list field of the Action parameter

  5. Type www.flashfoundry.com in the URL To Load parameter's text field after the http://. The default option for the URL Target parameter is Self. This will cause the http://www.flashfoundry.com URL to load into the current browser window (when this example is viewed on the Web).

  6. To load the URL into a new browser window, click the down-arrow to the right of the list field in the URL Target parameter and select New Window from the list.

  7. When you are finished, click the Close button.

    Before we test or publish the movie to view the changes, let's enter a few more URLs.

  8. Select Item 2 in the Sub Item For Main Item #5 parameter and change the text to Eyeland Games.

  9. Click the Edit Click Action button and select Load URL from the Action list field.

  10. In the URL To Load parameter text field, enter http://www.eyeland.com/games-all.php.

  11. Select New Window for the URL Target parameter (see Figure 5.12).


    Figure 5.12: Entering a new URL for the second item in the Sub Item For Main Item #5 parameter

  12. Click the Close button.

Here you see that you can enter URLs for scripts like PHP and ASP. You can also use long URLs and those with special characters—anything that's legal as an HTTP address.

  1. Select Item 3 in the Sub Item For Main Item #5 parameter and change the text to Flash Talk.

  2. Click the Edit Click Action button and select Load URL from the Action list field.

  3. In the URL To Load parameter text field, enter the following URL:

    http://www.graphics.com/modules.php?name=Sections&sop=viewarticle&artid=27

  4. Go ahead and leave the Self option as the value for the URL Target parameter (see Figure 5.13).


    Figure 5.13: Entering a new URL for the third item in the Sub Item For Main Item #5 parameter

  5. When you are finished, click Close and then close the Component Parameters panel.

Now that you've edited several of the items, let's test the movie to see how it works. For this example, you need to view the overall movie in a browser so that you can observe if the target options you selected in the URL Target parameter are working properly.

To do this, choose File Publish Settings to open the Publish Settings dialog box. Click the Formats tab and make sure that the Flash and HTML options are selected, as shown in Figure 5.14. Next, click the Publish button, and when the movie has finished publishing, click OK to close the dialog box.

click to expand
Figure 5.14: Turning on the Flash and HTML options

When you clicked the Publish button in the Publish Settings dialog box, Flash published both an .swf file and an .html file in the directory that you stored the take2.fla file on your local hard drive. Now go to that directory with Windows Explorer or your Mac's Finder and open the take2.html file in a browser (see Figure 5.15).

click to expand
Figure 5.15: View the take2.html file in a browser to test the movie.

Now roll your mouse over the Links header on the dropdown menu and then click each of the submenu items in turn. Notice that the first two submenu items (Flash Foundry and Eyeland Games) launch a new browser. However, when you click the last submenu item (Flash Talk), the URL loads into the same browser window. Once you've tested the movie, close the browser window and return to the take2.fla file in Flash.

Now that you've learned how to set the Drop Down Menu component to load a URL, let's look at the next click action: loading a movie.




The Hidden Power of Flash Components
The Hidden Power of Flash Components
ISBN: 0782142109
EAN: 2147483647
Year: 2002
Pages: 111

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net