Does it work better if you move your click event from the Labels to the ItemRenderer
Not a bad idea, but no, it makes no difference. I tried it on the HGroup, as well. I also removed the redundant HGroup. None of that made a difference, nor did listening on mouse_down instead of click. This simply seems to be a feature of Adobe events, albeit one that my users find very annoying.
Is this running on a mobile device?
can you listen to the click event on the list?
then check the target.id to see which label the click was over
use the currentTarget.selectedItems to see which item was clicked
dont know how reliabke that would be, just an idea
No. It is running on a hefty PC. Windows XP Professional 64 bit. 8 processors 1730 Mhz. 8 gig of RAM. If that's not enough machine to run Flex, I think the target market is pretty small.
I have experimented with hanging the listeners in all sorts of places.
If the mouse_down and mouse_up are not over the same object, no event is generated. If they are the same, the generated event has all the expected values. This seems to be an intentional feature of actionscript, but my users are complaining about it.
I only ask if you're running on a mobile device because when interactionMode=touch there is logic that is designed to cancel click events if the user is actually scrolling rather than pressing (see "Touch Cancellation Behavior for Components" in http://opensource.adobe.com/wiki/display/flexsdk/Mobile+List%2C+Scroller+and+Touch).
Since you're running on PC I'm assuming that your in a typical desktop Flex project. Try putting the click event on the ItemRenderer object, but not on the Labels, then set those Labels to mouseEnabled=false.
What about just listening for mouse down?
Do you mean that during a click the mouse goes down over the button, but goes up over another component ?
That's what it sounds like so it won't count as a click event.
If you have two renderers stacked vertically, and are moving fast enough (or
have a slow finger), you can mouse down on the bottom pixels of one renderer
and mouse up on the top pixels of the other, and then there won't be a click
event. The definition of click is mouse down and mouse up on the same
There is code in the MX list classes that decide on the selected item based
only on mouse down and mouse up events, not click. You might need to do
something like that here.
Can you use the List's change event instead of a click on an item renderer?
Putting the listener on the ItemRenderer and disabling the mouse on the Labels made no difference.
As to the other replies about mouse_down:
as I noted in one of my previous replies, I attempted to listen for mouse_down instead of click. That made no difference. As far as I can tell, if the mouse_up doesn't happen over the same object as the mouse_down, the mouse_down isn't generated.
My users are clicking on the rendered item, then moving the mouse over the adjacent item in the list, and they are doing it fast enough that the first click is ignored. I didn't spot this myself during development, but users are not always as precise as developers. So far this is an open issue in usability testing (QA). I don't want to claim (in writing, while closing the issue) that this is a "feature" of Flex and then find out I'm wrong. It could make me look bad, and hurt the internal view of Flex, which was not a straightforward sale.
Using the List change event is the correct answer.
Thank you. That's the ticket. Works great.
Editing my previous reply doesn't seem to be working.
Using the List change event was the correct answer.
Good to hear. In general using the change event is recommended over adding click listeners to the renderer. Just be aware that if you click on an already selected item you won't receive another change event (since the selection didn't change).