Results 1 to 4 of 4

Thread: Dropdown select box or scolling selection

  1. #1
    Join Date
    Jan 2008
    Location
    Near Chicago
    Posts
    247
    Thanks
    105
    Thanked 2 Times in 2 Posts

    Default Dropdown select box or scolling selection

    This is the script that I am trying to work with

    "myList" is the instance name of the box

    myList.addEventListener(Event.CHANGE, itemChange)

    function itemChange(e:Event):void
    {
    trace(myList.selectedItem.label);

    }
    -that works


    what I need to know is what syntax to use for choosing a specific item because I want to trigger an event after a selection
    Last edited by evan; 08-05-2008 at 06:02 PM.

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    I don't see a question in there. Are you asking how to create one from scratch? Instead of the CS3 Combobox component?
    Last edited by Medyman; 08-04-2008 at 10:22 PM. Reason: fixed link

  3. The Following User Says Thank You to Medyman For This Useful Post:

    evan (08-05-2008)

  4. #3
    Join Date
    Jan 2008
    Location
    Near Chicago
    Posts
    247
    Thanks
    105
    Thanked 2 Times in 2 Posts

    Default

    I needed to know which component to use thanks -got 90% --see above to clarify my question better

    This link gives an intro to how to use it.


    Here is an as2 tutorial

    Any ideas about how to set conditions or trigger different functions based on selections in AS3?

    THE ANSWER IS BELOW
    Last edited by evan; 08-05-2008 at 07:05 PM. Reason: more

  5. #4
    Join Date
    Jan 2008
    Location
    Near Chicago
    Posts
    247
    Thanks
    105
    Thanked 2 Times in 2 Posts

    Wink The Answer

    This is the AS 3 version

    with this I am navigating inside a movieclip and returning a response using "trace".



    var State:String;
    myList.addEventListener(Event.CHANGE, itemChange)

    function itemChange(e:Event):void
    {


    //this works
    //trace(myList.selectedItem.label);

    //this works
    //trace(myList.selectedItem);

    //this works
    State=(myList.selectedItem.label);
    trace (State);

    if(State=="Chicago"){trace("you are cool");testobject_mc.gotoAndStop(3);}
    else{trace("you are not from Chicago");testobject_mc.gotoAndStop(1);}

Bookmarks

Posting Permissions

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