A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Combo Box

  1. #1
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167

    Combo Box

    Hey everyone

    Yes, I am asking how do utilize a combo box in Flash and yes I know thats pretty low of me, but hey, were all here to learn right?

    Anyways, Ive read the Flash help and it hasnt given me much help, so Ive decided to come to my favourite source of Flash help which was here


    So I have this combo box that has a list of items in it , and all I want it to do is simply display the selected item into a Dynamic Textbox with the var 'text'

    I tried using the getValue() ; and that seemed to work ... sort of.

    So if anyone could please tell me how to go about using these things, it would be greatly appreciated

  2. #2
    How should I know!? Biff Tanon's Avatar
    Join Date
    Jun 2001
    Posts
    748
    I got bit by these too.
    I had a dropdown that had a list of things. I named it "Ltype"

    Put this code in the first frame (keyframe)
    You will need to change the values and such to fit your needs of course, but this should help you get going.
    code:

    function displayType (Ltype) {
    thaType = Ltype.getSelectedItem().data ;
    if(thaType == "valueOne") {
    trace("value one");
    //getURL(yourURL.com", "_blank");
    } else if (thaType =="valueTwo") {
    trace("value two");
    //getURL(yourURL.com", "_blank");
    } else if (thaType == "valueThree") {
    trace("value three");
    //getURL(yourURL.com", "_blank");
    } else {
    trace("other value");
    //getURL(yourURL.com", "_blank");
    }
    }



    Then on my button I have this:
    code:

    on (release) {
    displayType(Ltype);
    }


    Hope that helps!
    [something cool goes here]

  3. #3
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167
    Biff Tanon

    Many thanks for the quick reply , Ill get straight to work on it , and from what I see it'll work perfectly

    I wont tell you how far off I was though :P

    Haha, anyways thanks again

  4. #4
    How should I know!? Biff Tanon's Avatar
    Join Date
    Jun 2001
    Posts
    748
    Let me know if you need any help with the code.

    cheers!
    Last edited by Biff Tanon; 10-18-2005 at 09:59 AM.
    [something cool goes here]

  5. #5
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167
    Ok so I copied your code without an error or trouble and arranged it so it would apply to my needs

    But theres a small problem , the text box is not changing to the what I want it to after selecting from the combo box and clicking the button

    I made a small .fla with the problem if you could please check it out?

    Many thanks
    Last edited by Osteel; 05-01-2009 at 02:39 AM.

  6. #6
    How should I know!? Biff Tanon's Avatar
    Join Date
    Jun 2001
    Posts
    748
    I think the problem is that there is no values in the dropdown.
    I inserted some values (Data) in the dropdown and I was able to get the textbox to show the names. See if that helps.
    Attached Files Attached Files
    [something cool goes here]

  7. #7
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167
    OH I understand it now , I thought that might have been the reason, but when I was reading up on combo boxes in the Flash Files, they didnt use the Data part of the combo box and so I suppose I got confused and assumed I didnt either

    Anyways, its works

    Thanks for the help

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