简体   繁体   English

Flex 4数据组项目渲染器坐标

[英]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. 我想要一个可以在不同Flex 4列表控件中的选定项目之间绘制线条的叠加层。

The problem is I can't figure out how to access the x, y coordinates of the list's item renderers. 问题是我不知道如何访问列表项渲染器的x,y坐标。

Any help appreciated. 任何帮助表示赞赏。

Ok, far better solution: 好的,更好的解决方案:

DisplayObject provides a localToGlobal function , which takes some local coordinate and converts it into a global coordinate. DisplayObject提供了localToGlobal函数 ,该函数获取一些局部坐标并将其转换为全局坐标。

:) :)

When the Skin object calls localToGlobal(this.x, this.y) voila! 当Skin对象调用localToGlobal(this.x,this.y)时! We have our global x,y coordinates. 我们有全局的x,y坐标。 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. 因此,通过单击列表项来触发线条绘制,因此,我可以通过在项目渲染器init函数中为mousedown事件设置侦听器来访问项目渲染器坐标。 Doesn't quite answer this question but does solve my issue. 不是很回答这个问题,但确实解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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