A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [RESOLVED] Target specific combobox item

  1. #1
    Senior Member jweeks123's Avatar
    Join Date
    Mar 2006
    Posts
    1,124

    resolved [RESOLVED] Target specific combobox item

    How would you go about targetting a specific combobox item selected. Like say I click on the 3rd item in the dropdown list and then I want to take that item and change it's text format and make it unselectable but keep everything else normal.

    Any way of doing this?

    Any ideas?

    Thanks.

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    You use this class:
    http://flashscript.biz/flashas3/data...enderer_2.html
    In the drawbackground function you change the textformat and add the line:
    enabled=false;
    Then when you instantiate the combobox you add this line:
    myCombo.dropdown.setStyle ("cellRenderer",MyCellRenderer);

    dropdown is the List component for the combobox.
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Senior Member jweeks123's Avatar
    Join Date
    Mar 2006
    Posts
    1,124
    Thanks. I appreciate the info.

    I also found this just before I got this reply if anyone else is interested.

    Keep in mind this was in a loop referencing comboboxes in a "holderMC" All instance names were stored in an array called cArray.

    Hope this helps as well as cancerinforms post.

    Thanks again.


    //Cell Renderer
    var cr:CellRenderer =this.holderMC[cArray[i]].dropdown.itemToCellRenderer(this.holderMC[cArray[i]].dropdown.selectedItem) as CellRenderer;
    var listData:ListData = cr.listData;

    cr.enabled = false;
    trace("You have selected row: " + listData.row);
    this.holderMC[cArray[i]].drawNow();
    //end Cell Renderer

  4. #4
    Senior Member jweeks123's Avatar
    Join Date
    Mar 2006
    Posts
    1,124
    Also when doing this, you would be better off using the script from cancerinforms post earlier, and setting a style for each combobox cellrenderer your using.

    Corresponding post here:

    http://board.flashkit.com/board/show...30#post4071330

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