Adding Named Anchors


Flash Player 6 and higher give Flash movies extended functionality in some Web browsers, allowing the Back and Forward buttons of the browser to navigate to areas within the Flash movie. In earlier versions of the Flash Player, the Web browser's Back button would reset the position of the Flash movie to the first frame every time the movie reloaded into the browser. Now, you can add named anchors to Flash movies. Named anchors, when played, alert the browser's history to the location of the current anchor within the Flash movie. When another anchor is played, you can click the browser's Back button to go back to the previous named anchor.

Caution 

Named anchors are only supported in Web browsers that support fscommand and JavaScript interactivity. Currently, Internet Explorer 4 (or higher) on Windows or Netscape 3.x to 4.x on Windows or Macintosh supports the named anchor feature of Flash Player 6 and 7. Netscape 6 (on any platform) or Internet Explorer on Mac (any version) does not support named anchors.

You can add named anchors to Flash movies in two ways:

  • Enable the Named Anchor on Scene option in the Preferences dialog box. On Windows, you can access the preferences by choosing Edit ð Preferences. On Mac OS X, choose Flash ð Preferences. You will find the Named Anchor on Scene option in the General category of the Preferences dialog box.

  • Choose the Anchor option in the Label type menu of the Property inspector. Select a frame in the Timeline window, assign a frame label, and choose the Anchor option in the Property inspector.

In the presentation you're building in this chapter, you do not use any scenes. Therefore, you will add named anchors to all of the frame labels you created in previous sections.

  1. Open the last Flash document you created from the previous section. Select frame 10 of the labels layer, and open the Property inspector. Select the Anchor option in the Label type menu, underneath the Frame Label field.

  2. Repeat Step 1 for frames 20, 30, and 40 of the labels layer.

  3. Open the Publish Settings (File ð Publish Settings). Click the HTML tab, and choose the Flash with Named Anchors option in the Template menu. Click OK to close the Publish Settings dialog box.

  4. Save the Flash document as main_700.fla, and preview the presentation by choosing File ð Publish Preview ð HTML. Flash 8 creates the Flash .swf file and .html file, and opens the default Web browser. If you have a supported Web browser, you can click each navigation button (that is, Introduction, Video Equipment, and so on) and see the browser's history update. After you have clicked in one section, you can visit the previous section by clicking the browser's Back button.

On the CD-ROM 

You can find the main_700.fla document in the ch20 folder of this book's CD-ROM.

Web Resource 

To read more about an advanced method of using the Back button with Flash movies and browsers, peruse the Flash and Browser Interactivity category links at www.flashsupport.com/links.




Macromedia Flash 8 Bible
Macromedia Flash8 Bible
ISBN: 0471746762
EAN: 2147483647
Year: 2006
Pages: 395

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