Rhuno
11-07-2008, 09:12 PM
Hey all, I'm relatively new to Flex and am working on an application that needs to center the display based on where the mouse is clicked. The display is contained within a container that has both vertical and horizontal scroll policies set to 'on.'
When the user clicks somewhere in the display I want to manually move the scrollbars so that the point they clicked is centered in the viewing area. Now, I know I can set the scroll position by using verticalScrollPosition and horizontalScrollPosition, but I'm running into trouble trying to calculate the proper values for those properties based on the mouse click position.
Any ideas?
When the user clicks somewhere in the display I want to manually move the scrollbars so that the point they clicked is centered in the viewing area. Now, I know I can set the scroll position by using verticalScrollPosition and horizontalScrollPosition, but I'm running into trouble trying to calculate the proper values for those properties based on the mouse click position.
Any ideas?