A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: drop down menu

  1. #1
    Join Date
    Aug 2000
    Can anyone point me to a drop down/pull down menu tutorial.

    Also if I use a drop down menu from the library how do I add URLs to drop down options??

    All responses appreciated.


  2. #2
    Ok here is how I would make a quick link menu:

    1) Drop in the "Menu" smart clip
    Window > Common Libraries > Smart Clips > Menu
    Note: name the Instance of the clip "menu"

    2) Right click on it and choose:
    Panels > Clip Parameters

    3) A window will open that looks like this:
      Name | Value            
      items | (Array[])        
      style  | Auto
    4) Double click on "(Array[])". Now another window pops up. This is where we input the menus items.
     Sample Data:
    5) Click "Ok"

    6) Now make a button next to the right of the pull down. Make a label like "Go"

    7) Next we need to right an action script that will look to see which item is selected and then go to the right URL.

    on (release) {
    if ( menu.currentValue eq "Yahoo" ) {
    	menuLink = "http://www.yahoo.com";
    } else if ( menu.currentValue eq "Disney" ) {
    	menuLink = "http://www.disney.com";
    } else if ( menu.currentValue eq "Cnet" ) {
    	menuLink = "http://www.cnet.com";
    } else if ( menu.currentValue eq "Flashkit" ) {
    	menuLink = "http://www.flashkit.com";
    	getURL (menuLink);
    7) That is it.

  3. #3
    Join Date
    Aug 2000

    Drop Down Menus

    Cheers for the reply.

    Unfortunately I cant follow your suggestions. I am using Flash 4 and cannot locate Window > Common Libraries > Smart Clips > Menu.

    It is Monday morning and I could just be being slow, but additional pointers would be appreciated.


  4. #4
    Well ya did post in the Flash 5 section. I will see if I can come up with something for you.

  5. #5
    Junior Member
    Join Date
    Jun 2000

    drop down menus/ flash 5 smart clips - long


    making a flash 4 drop down menu isn't too bad -- but it's not very size-efficient! <sigh>

    there is a sample movie clip on the help menu "widgets" stuff in flash 4.

    basically what you do is make a 3-frame movie clip. in the first frame draw your textfield (don't forget to name it), your background, your button. in the second frame, enter your list items: choice 1, choice 2, etc. put an invisible button over each list item. the invis button should have a go to frame 3 action and a set variable action with the name of the list item. this way, when the button is clicked, the movie will go to frame three, and the textfield will display the variable that corresponds to the list item chosen.

    does that help? the problem is that a drop down movie clip made this way begins empty at about 7k and will quickly grow to about 20k! this is probably why you don't seem 'em very often.

    my problem is flash 5's version of the drop down menu. i see how to use the clip parameters to set the list items, but i can't for the life of me figure out how to capture the user choice and set it to a variable on the main timeline so i can use it in a form. using the new movie explorer on it certainly offers a lot of code, but there's not much documentation to tell you what to do with it! <sigh>

    say i have a menu for a form that contains countries: Algeria, Aruba, etc. let's say i name the clip instance "countrycode." i need to grab the user choice, Algeria, and set a variable CountryCode on the main timeline to ALG so it can be passed to a form script in perl.

    i would think i could get at the user choice by setting a variable like so
    "CountryCode = _level0.countrycode.currentvalue"
    if i do this and look at the variables window in test movie, "CountryCode" comes out to "ListValue," which is one of the many, many objects in this smart clip.

    jasonlatta's excellent method (above):

    on (release) {
    if ( menu.currentValue eq "Algeria" ) {
    CountryCode = "ALG";
    } else if ( menu.currentValue eq "Australia" ) {
    CountryCode = "Aus";
    } else if ( menu.currentValue eq "Argentina" ) {
    CountryCode = "ARG";

    would work if i could put it somewhere on the button. i'm just not sure where it should go when i look at all that code in the explorer!

    i would rather be able to simply evaluate what's in the textfield and set the variable based on that, rather than the button press.

    even so, basic tests indicated that this menu movie clip will not be any more size-efficient than the flash 4 version, and is more complicated to set up and maintain!<sigh>

    what am i missing? all hints and insights deeply appreciated! <g>




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center