Reputation: 387
I've got a label inside a panel, and I've drawn a line to that label. So I need to know when the label moves to update the line. Is there a way to know when the label moves, I can listen for when the label moves inside the panel, but is there a way to know when the panel moves? (which moves the label inside) which might be inside another panel or another panel?
I can set up an eventlistener on the EnterFrame and convert the label origin to localToGlobal and see if it changed, but it seems like overkill...
thanks,
Upvotes: 0
Views: 122
Reputation: 39408
You can use the move event to tell when a Flex Component moves.
It is tough to expand on the answer without more details of your code. But, I suspect you may be better off drawing the line and positioning the label as part of the Panel's local co-ordinate system, and then when the Panel moves you won't have to worry about repositioning the label and your line.
You could wrap the label and line in a single component for this purpose. Instead of moving the label specifically; you could move a custom "LabelAndLine" component.
Upvotes: 1