Home > Articles > Graphics & Web Design > Dreamweaver & Flash

This chapter is from the book

This chapter is from the book

Customize the Navigation Bar

There are many graphic elements that you can customize to fit the look and feel of your site, but there are several items that you must modify so that the navigation bar will work with the rest of the movies. You will also need to alter the number and name of the buttons so that the navigation bar is appropriate to your site. The options for changing the look of the navigation bar are placed at the beginning of this section, but you'll should make the modifications to the number and name of the menu items before you modify the aesthetic elements so you don't spend time modifying an element you may delete.

The Background, Color, and Shape

Changing the background color of the Navigation Bar movie itself won't affect the navigation bar. It will be loaded into a level inside of another movie, and that information will be striped off when it's imported into the secondary movie. The symbol titled hn_NavBarShell contains the color and shape of the navigation bar itself, the color of the background and outline can be edited easily with the stroke and fill options in the Tool palette. You can also change the shape, but make sure the subsequent elements are adjusted to fit this new configuration.

The site that I am creating has a high-energy feel, so a gray and blue navigation bar is too sedate and low key for my purposes. I've chosen a warm palette for the navigation bar for my friendly robot manufacturer. After I modified the number and names of my buttons, I used the stroke and fill options to choose the Web safe browns, greens, and oranges that now make up my navigation bar.

Figure 3.4 Timeline of the hn_NavBarShell graphic symbol with new colors and Movie Background color set to white.

Forward and Reverse Buttons

You can change the shape, color, and size of the Forward and Reverse buttons by editing the button symbols hn_left and hn_right. You can also create or import your own graphics to construct a button. If you create a new button, it's best to use the Instance panel to swap out the instance of the symbols in the Timeline. If you delete and replace the buttons, you'll lose the code that's attached to those instances, and the sliding action will no longer function.

I created a new set of graphics for the Forward and Reverse buttons using the drawing tools available in Flash. I decided that the current buttons have too much of a hard technology edge for my lay out, and that I want my buttons to be simple and friendly. After I created my arrows, I swapped out the graphics in the hn_left and hn_right button symbols and used the fill option to change the darker yellow to a lighter yellow on rollover.

Figure 3.5 Timeline of the modified hn_left button symbol in edit mode on the Stage.

Main Menu Buttons

You may want to change the font face and text point size of the buttons. It's easiest to do this straight from the Library rather than on the Stage. The buttons for each category are inside of the folders titled with their category. For example, the button for the main menu Cart button is inside the folder titled hn_cart_elements. You can go down the list and make sure that you've made the same alterations to every button. You can also change the background color of the rollover state as easily as you would any symbol.

Figure 3.6 The hn_cart_but button located in the hn_cart_elements folder as it appears in the library.

I needed to make sure that the text in my buttons was legible against the new background color of my navigation bar. The provided font face is Arial and, for me, this choice still makes sense because it's straight forward and easy to read. However, the font face color is light gray, which now looks faded in comparison to my new colors. So I changed the font face to white. The font face color in the rollover state is blue with a gray background; this looked muddy in my new navigation bar so I change the font face color to black with a white background.

Sub-Menu Buttons

You will need to change a few lines of code in the sub-menu section so that your buttons will load the correct movies. It will also be necessary to change the number and labels of your sub-menu buttons to reflect your site navigation. You'll have the option of changing many of the graphic elements and transition animations for the buttons, but it's best to make the changes to the look and feel of the buttons after you have adjusted the number of sub-menu items to avoid creating more work for yourself than is necessary.

Appearance

You can easily change the background colors of the sub-menu buttons because they all use the same two graphic symbols. This means if you change the background color in the master symbol of the Up state for one sub-menu button, all of the buttons backgrounds are updated with the new color. The same is true for the background of the Over state of the button. Remember that the labels sit on top of the buttons inside the sub-menu Movie Clip. You will need to change the names of the sub-menu items to reflect your products and services. (We'll get into the specifics of that later.) The default alignment of the text on top of the buttons is set to centered. You may prefer that the text align left or right. You can change the font and color of the text, but keep in mind that you'll need to do this for every button; there's no shortcut for this procedure. Edit the text directly on the Stage so that you can see how your changes will look in the context of the entire layout.

I chose to change my backgrounds for the button in the mouse up position from blue to chartreuse and the color of the mouse down background from green with a black arrow to yellow with a black arrow. I left the font choice and font face color of the button alone.

Sub-Menu Button Links

The purpose of the sub-menu buttons is to provide users with a way to get to the category that interests them. The sub-menu buttons are set up with the code you'll need to load these new Flash movies into the current location. The code is attached to the buttons in the Sub-Menu Movie Clips; these Clips are titled hn_"category"_sub: For example, the demos Sub-Menu Movie Clip is titled hn_demos_sub. To view the script you need to click the background of the button itself because the text label sits on top of the actual button. When you look at the code it reads as follows:

/*
To change the movie that loads when the button is clicked, change the name of the swf,
and the level, if desired.
Don't forget to uncomment the code below when you have made your changes.
*/

on(release){
 _parent.gotoAndStop(1);
 //loadMovieNum ("media.swf", 0);
}

Figure 3.7 Timeline of the modified Sub-Menu button in edit mode on the Stage.

As the comments indicate, you'll need to change the name of "media.swf" to the name of your .swf movie to ensure your movie will be loaded on the mouse event. You will also need to remove the // marks before the loadMovie command so that Flash recognizes the script as code and not a comment.

Changing the Pop-Up Menu to a Drop-Down Menu

Because the navigation bar is draggable, the user can place it anywhere they'd like in the movie at run time. You have the option to change the direction of the sub-menu animations from a pop-up to a drop-down menu. To change the direction to a drop-down menu, you'll need to enter each Sub-Menu Movie Clip and move the button instances and text label on the Stage so that the buttons appear below the navigation bar instead of above it. For this task it's best to use the Info panel to adjust the X and Y coordinates. You could move the button groups, made up of the button instances and text, by hand, but using the Info panel will ensure that the button groups are aligned with accuracy. Adjust the Mask layer in the hn_NavBarScroller Movie Clip to cover the new coordinates so that your Sub-Menu buttons won't vanish or appear cut off.

I've chosen to modify my sub-menu items from the pop-up to the drop-down style.

Figure 3.8 Timeline and Stage screenshot that shows final location of drop-down change.

Changing the Number of Main Menu Items

This movie is a model from which you'll base your Flash site. It's doubtful that the main menu items provided will match your information. You may want to add or subtract items to or from the list. We've already covered renaming the buttons. Adding and subtracting items, however, takes a bit more effort. Let's begin with subtracting items.

Subtracting Main Menu Items

It's best to subtract items from the end of the list because it makes adjusting the slide animation easier.

  1. Double-click the hn_NavBarScroller Movie Clip in the Library. This can be found in the folder titled NavBarScroller which, in turn, is inside of a folder called hz_navigation.

  2. Scrub the play head over keyframe 22 of the Scroll layer and double-click the Stage over the navigation bar. You'll find yourself in the edit mode for the hn_menu symbol.

  3. Start with the last menu item on the right and delete as many Movie Clip instances as it takes to get to the correct number of items for your movie.

  4. Go back to the hn_NavBarScroller Movie Clip and look in the Timeline. The top layer titled Labels tells us where important keyframes are located. These labels indicate the direction that the navigation bar will move when the forward and reverse buttons are clicked at run time.

  5. Click the keyframe in the Scroll Layer that falls in front of the 3-2 label. Use the Info panel to adjust the X coordinate so that the last item in the list sets in the last space on the right side of the navigation bar.

    NOTE

    Note: Using keyframe labels is the simplest way to mark off a certain spot in the Timeline when you need to use code to refer to events. If this navigation bar didn't use the labels, your button code soon would because a cryptographer's dream of frame numbers—you'd have to write yourself a cheat sheet to keep track of what was happening, when, and where.

  6. Place the play head in between the frames labeled 3-2 and 2-1, and remove four or five frames (Shift + F5). Remove the same number of frames from the Scroll Layer between 2-3 and 3-2 labels.

This will shorten the time that it takes the menu items to tween across the bar. If you didn't compensate for the fewer number of items, the slide in the last section will appear much slower than the slide through the first two positions.

Adding Main Menu Items

As an example, let's add a category titled Tricks.

  1. Add a new folder to your Library inside of the folder NavBarButtons, and name it the same as your new category so you can spot it easily. Mine is called hn_tricks_elements.

  2. Open up the folder above it. In this case, that folder is hn_tips_elements. Using the Duplicate feature in the Options menu of the Library, duplicate all three symbols that you find in that folder: the button, the Main Item Movie Clip, and the Sub-Menu Movie Clip. Rename the copies of the duplicated symbols with your new category name. For instance, I've named my symbols hn_tricks_but, hn_tricks_mov, and hn_tricks_sub. Move them into the folder you created to hold these elements.

  3. You will need to make sure that the symbols in your new category are updated to reflect your new category. When you duplicated your hn_"category"_mov, an instance of the previous category's Sub-Menu Movie Clip was inside of the Movie Clip. You will need to replace this Sub-Menu Movie Clip instance with an instance of your new Movie Clip. Double-click the hn_"category"_mov Movie Clip in the Library. Lock down all of the layers except the Sub Menu layer, and move the play head to frame 2. Click once on the Stage on top of the instance of the Sub-Menu Movie Clip. Use the Swap Symbol tool in the Instance panel and chose the new Sub-Menu Movie Clip. In my case I swapped the symbol instance of the Movie Clip hn_tips_sub with an instance of the Movie Clip hn_tricks_sub. If I hadn't done that, my Main Item Movie Clip hn_tricks_mov would still be referencing the instance of the Sub-Menu Movie Clip hn_tips_sub.

  4. Double-click the new button symbol that you've just made in the Library and modify the text on the button to reflect the name of your new main menu category. In my case the new name is Tricks.

  5. Return to the Library, double-click your Sub-Menu Movie Clip and modify the Movie Clip to reflect number of items from which you'd like the user to choose and their names. (See the section, "Changing the Number of Sub-Menu Items," for information on adding or deleting Sub-Menu buttons.)

    Figure 3.9 The Library showing new elements and how they should be organized.

  6. Return to the hn_NavBarScroller Clip, and scrub the play head across the Timeline until it's over keyframe 22. Double-click the Stage on top of the navigation bar. This places you in the hn_menu graphic symbol.

  7. Place an instance of the new Clip in the hn_menu symbol on the Stage at the same Y coordinate of the other Clips and at an X coordinate approximate 130 pixels to the right of the last item on the list.

  8. Return to the Timeline in hn_NavBarScroller Clip and go to keyframe 22 in the Scroll layer again. Click on that keyframe and use the Info panel to change the X coordinate of the hn_menu symbol so that the hn_menu symbol shifts to the left until the new category appears at the to the right at the end of the list.

    Figure 3.10 The new main menu button placement in context of the navigation bar.

  9. Now you'll need to compensate in the animation time for the longer list. Add four to five frames (F5) to all of the layers between the labels 3-2 and 2-3.

Changing the Number of Sub-Menu items

It's unlikely that each sub-menu button fits your needs. You will need to either add or subtract buttons to the sub-menu animation to reflect the number of movies the user has the option of viewing.

Subtracting Sub Menu Items

I've chosen the Sub-Menu Clip for the demos section as my example.

  1. Double-click any of the sub-menu Movie Clips in the Library. In this example, it's hn_demos_sub.

  2. The top layer of each sub-menu Clip begins with an Actions layer and is followed by one layer for each button. Delete the first and second button layer under the Actions layer.

  3. Move the keyframe in the Actions layer that contains the stop() script so it's over the last keyframe of animated buttons.

  4. Delete all of the keyframes that extend past the stop action keyframe.

    Figure 3.11 The Timeline after the button has been taken out and adjustments made.

Adding a Sub Menu Item

Let's add a button to the Sub-Menu Clip. I've used the Company section as an example.

  1. Double-click any of the Sub-Menu Movie Clips in the Library, such as hn_company_sub.

  2. Add a new layer under the Actions layer; then add one frame (F5) to the end of each of the existing layers, so that all layers exist for the same length of time.

  3. Place a blank keyframe (F6) in the last frame of your new layer. Name the layer after your new button category. In this case the layer will be named Mission Button.

  4. Copy the button and text field from the frame below and paste an instance of both in the blank keyframe at the end of your new layer. Use the Info palette to align them—the X coordinate will remain the same, but the Y coordinate will be 17 pixels from the closest button instance.

  5. Change the text field to reflect the name of your new category. Change the ActionScript to include the name of the Flash Movie that will be loaded when the viewer clicks it.

  6. Move the keyframe with the stop() script to the last frame of the layer.

  7. Go to the bottom Background layer and extend the boundaries of rolloff background button to include the new sub-menu item.

    Figure 3.12 Timeline when a Sub-Menu button has been added.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020