views:

157

answers:

1

Background:
    I am doing some UI work where I allow the user to programatically add and resize controls on a canvas.

Problem:
    When resizing a combo box through AS the dropdown stays at the same width as the first time it drops down. So user places combo box on the page, clicks the down arrow, sees the options, selects an option or clicks down arrow again to close, resizes the width of the drop down, clicks the down arrow. Now drop down is the same width as original. Have tried simple things like setting the width of the dropdown specifically and invalidating display list but it still doesn't work.

Example:
    Code Example pending

A: 

While trimming my code down to an example I solved my problem. A combobox has a dropdownWidth property. I was trying to set this myComboBox.dropdownWidth = newWidth, which doesn't work (not entirely sure why, didn't dig into the SDK). However if I change my code to myComboBox.dropdown.width = newWidth it actually goes to the dropdown element and re-sizes it directly which does work.

invertedSpear
I'm pretty sure the comboBox.dropdownWidth property doesn't change the width "live". The comboBox.dropdown.width should however; which is consistent with what you seem to be experiencing.
www.Flextras.com