views:

654

answers:

2

I may be missing something here because I thought this might be really easy but...

Using Flex, how can you tell when a ComboBox is open? I do find the open and close events that this component dispatches can be flaky so I'm looking for something a little more solid - it's probably staring me in the face.

A: 

The designers probably thought it was enough with the open and close events.

EDIT: I'll clarify that. Looking for a property that would reveal the opened/closed status of the combobox I fail to find it. And to my experience there's nothing flaky about the event system.

PEZ
Maybe I need to clarify - the event system isn't flaky, but the close event that is supposed to be broadcast whenever the combobox is closed does not dispatch in every situation.
onekidney
Well, that's flaky =) And a bit strange.
PEZ
+3  A: 

How about checking either the existence or the visibility of the dropDown component?

The dropDown is a component of type ListBase, and can be accessed through the dropDown property. So maybe something like this (I didn't have time to test this myself):

if (myComboBox.dropDown != null && myComboBox.dropDown.visible) {
    // myComboBox is open
}

The myComboBox.dropDown != null is a safety check so you will not get runtime errors trying to access the visible property of a null object.

Niko Nyman