flex组件绝对位置

xiaoxiao2022-06-12  14

private function getUiAbsolutePosition(ui:UIComponent):Point//获取组件的绝对位置 { var point:Point=new Point(); point.x=ui.x; point.y=ui.y; var temp:DisplayObject=ui; do { var parent:UIComponent=temp.parent; if(parent!=null) { point.x+=parent.x; point.y+=parent.y; temp=parent; } }while(parent!==this.parentApplication && parent!=null ) return point; }
转载请注明原文地址: https://www.6miu.com/read-4933004.html

最新回复(0)