开发者

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 apprecia开发者_高级运维ted.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜