A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: ComboBox initially selected value help !!!!

  1. #1
    Junior Member
    Join Date
    Jan 2007
    Posts
    2

    ComboBox initially selected value help !!!!

    Have some issues with a ComboBox on a booking form the ComboBox contains all twelve months of the year for a user to select but I need the list to default to the current month whilst keeping the list in month order.

    Is there a way to set a label to be the initially selected value whilst keep the correct month order ?

    Any help on this would be great

    Code below fro the list

    <code>

    onClipEvent (construct)
    {
    editable = false;
    labels = [];
    labels[0] = "Jan";
    labels[1] = "Feb";
    labels[2] = "Mar";
    labels[3] = "Apr";
    labels[4] = "May";
    labels[5] = "Jun";
    labels[6] = "Jul";
    labels[7] = "Aug";
    labels[8] = "Sep";
    labels[10] = "Oct";
    labels[11] = "Nov";
    labels[12] = "Dec";
    rowCount = 4;
    enabled = true;
    visible = true;
    minHeight = 0;
    minWidth = 0;
    }
    <code>

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    combobox - instance name - month_cb
    code on main timeline -
    Code:
    labels = ["Jan","Feb","Mar","Apr","May","Jun",
    "Jul","Aug","Sep","Oct","Nov","Dec"];
    
    month_cb.dataProvider = labels;
    
    dd = new Date();
    mm = dd.getMonth();
    
    month_cb.selectedIndex = mm;
    hth

  3. #3
    Junior Member
    Join Date
    Jan 2007
    Posts
    2
    Quote Originally Posted by a_modified_dog
    combobox - instance name - month_cb
    code on main timeline -
    Code:
    labels = ["Jan","Feb","Mar","Apr","May","Jun",
    "Jul","Aug","Sep","Oct","Nov","Dec"];
    
    month_cb.dataProvider = labels;
    
    dd = new Date();
    mm = dd.getMonth();
    
    month_cb.selectedIndex = mm;
    hth
    Cheers thanks for you help just what i needed

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