Not sure this exist, but worth asking you all: is there a built in method to compute the distance between the current mouse position and a given component? If not, is there a simple way to build a function like this that works for components with generic shapes?
thank you!
Okay, say you want the distance from the mouse to the top left corner (the default for Flex in this case), just use Pythagoras’ theorem:
Again, this would be the distance from the top left corner of ‘theComponent’. If you want it to be from the center of the component, do this:
Every DisplayObject has this ‘mouseX/Y’ property which is always relative to the top left corner.