tags:

views:

751

answers:

2

I'd like to have an overlay that draws lines between selected items in different Flex 4 List controls.

The problem is I can't figure out how to access the x, y coordinates of the list's item renderers.

Any help appreciated.

A: 

So the line drawing is triggered by clicking the list items, and as such I can access the item renderer coordinates by setting up listeners for mousedown events in the item renderer init function. Doesn't quite answer this question but does solve my issue.

secoif
+1  A: 

Ok, far better solution:

DisplayObject provides a localToGlobal function, which takes some local coordinate and converts it into a global coordinate.

:)

When the Skin object calls localToGlobal(this.x, this.y) voila! We have our global x,y coordinates. So simple it's embarassing.

secoif