문제

In flex, I am getting the y-coordinate in the following way:

nextHBox = HBox(ingBox.getChildByName("ing" + nextId));

nextYAxis = ingBox.localToGlobal(new Point(nextHBox.x,nextHBox.y)).y;

newCanvas.x = nextYAxis;

nextYAxis gives me the y-axis and I use it to position new component. It works absolutely fine. But, when there is vertical scroll, and I scroll it a little bit, and then the above mentioned code places the component at wrong place. I believe, it has something to do with the scroll.

도움이 되었습니까?

해결책

You can factor in the scroll position of the parent container by adding the value of its verticalScrollPosition property to your y position.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top