Implement navigation bar flash based on JS

  • 2021-06-28 11:13:31
  • OfStack

1. Overview

In some personalized websites, flash navigation bar is the preferred navigation bar. flash navigation bar can bring better visual effect to visitors, which is the main reflection of the personality of the website.

2. Technical Essentials

The main application is release() method of Button class in Flash action script.The Release() method is triggered when the left mouse button is pressed and released.

The syntax is as follows:


on(release)
{
// Insert statement here 
} 

3. Specific implementation

(1) In Macromedia Flash Professional 8, create a new Flash document, click the Insert New Component command in the menu, select the Button radio button in the Create New Component dialog box that pops up, and click the OK button.

(2) Enter the text "Home Page" in the "Pop-up" keyframe, select the "Pointer Passes Through" frame, click the right mouse button, select the "Insert Keyframe" command in the pop-up shortcut menu, insert an animation element in the "Press" frame, and draw the action area in the "Click" frame.

(3) Return to the scene and drag elements from the library into the appropriate location in the scene.

(4) Select the button, open the Action panel, and enter the following code in the code area:


on(release)
{
getURL( " index.jsp " );
} 

(5) Make several buttons in turn, and then generate the SWF file.Insert the SWF file you just generated into the web page with the following code:


<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="767" height="80">
<param name="movie" value="navigation.swf" />
<param name="quality" value="high" />
<embed src="navigation.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="767" height="80"></embed>
</object>

Related articles: