Check out the special deal below:

More Deals!


Click here to learn more and make more!


Check out the AllAdvantage FAQ!

Get paid to surf. Make money off the Internet instead of the other way around.

Created on: July 8, 1997
How do I create a Combo Box Navigation Menu System?


I am trying to set up a combo box to act as a navigational guide for my
application.  The drop down menu might contain a list like the
following:

Quit
Go to frame 23
Go to frame 47
Go to frame 64

How do I set the event editor so that each line will take the user to a
specified frame.

I have already tried the following the "retrieve data from an object"
route (when you click on a "GO" button).  This works fine if the
destination frames are consecutive.

Christopher Benjamin
cb5e@virginia.edu



I'm not sure how detailed I need to be so forgive me if I drag this out too much. But I figure it is better to be too detailed than not detailed enough.

First of all I created a new application and added a Combo Box to the available Frame.
 

Frame Editor:

Under Type of Combo Box I selected Dropdown List. This will stop users from being able to modifying the displayed text.
I left the Options section set to its defaults.
I added the four lines listed below to the Content of Combo Box area.

Frame 1
Frame 2
Frame 3
Exit

Next I added two text objects. One set to display, "Current frame is X." and the other to show, "Current selection is X."

Finally I added a Push Button Control and set it to say, "Go!"
 

Now to the Event Editor:

Condition 1: Start of Frame
   Under Combo Box
      Set current line to frame - 1
   Under Text Object "Current frame is X..."
       Set alterable value to "Current frame is " + str$(frame)
   Under Text Object "Current selection is..."
       Set alterable value to  "Your current selection is " + str$(List Select("Combo Box"))

Condition 2: Combo Box Selection Changed?
   Under Text Object "Current selection is..."
       Set alterable value to "Your current selection is " + str$(List Select("Combo Box"))

Condition 3: Button Clicked
            Compare Two General Values: Combo Box Selection <> 3
            Compare Two General Values: Combo Box Selection <> frame - 1
   Under Storyboard Controls
      Jump to Frame number List Select("Combo Box") + 1

Condition 4: Button Clicked
            Compare Two General Values: Combo Box Selection = 3
   Under Storyboard Controls
      End the Application

Well I know that difficult to follow but I can't think of anything I can do that will not make it worse.

The first two conditions are pretty much straight forward except maybe for the use of the str$ function. This functions converts numbers into text. It's a real handy function.

In the third and fourth functions I used the Compare Two General Values to see if the user wanted to exit which means the current Combo Box would be equal to three and to see if the user was trying to go to the current frame this was done by using the frame function. The frame function returns the value of the current frame as a number.

Everything else should be old hat.

Now go to the Storyboard Editor and copy this frame. Now paste it twice. You should now have three identical frames. If you want to add the Combo Box Menu System to an application you already have created you could just copy and paste all of the code and objects you'll be using.

All that's left now is to run the application.

I've included the source code for you to download which should help with your understanding.
cbmenu.zip (4 KB): Download Click & Create source code for Combo Box Navigation Menu System.


This page and all of its contents are Copyright 1997-98 by Christopher Jay Craft.

1