简体   繁体   中英

Flex 4 Datagroup Item Renderer coordinates

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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM