1 person found this helpful
You could just add a test. Something like:
Var foo:DisplayObject = DisplayObject(event.target)
if (foo is IItemRenderer)
// renderer got clicked
if (foo is List)
break; // wasn't in a renderer
foo = foo.parent;
do you need the reference to the item renderer by force or could you immagine a different approach? If you could work around that you could use the change event instead of the click event. The change event gets fired whenever the selection of items in the list change. A click on an item renderer of course will change the selection if the underlying item isn't already selected.
If you can't work around the need of an item renderer reference you should experiment with the mouseChildren property of the List component (inherited from DisplayObjectContainer, see http://bit.ly/dhqCFS). IMHO of course
Thank you, the change event works just fine. I had heard of it before, but thought I read that it would detect the first change, but not the other ones. Now that I know that isn't the case, I'll be just fine. This solution is simple, which is just how I like it.
Thanks for the help.