Flash has built-in properties mouseX and mouseY which let you know the current location of the mouse pointer. This can be used in Flash games for example. To query these values on a continuous basis, you can set up an event listener that fires on every frame.
Download the FLA filevar myTextField:TextField = new TextField(); var myTextFormat:TextFormat = new TextFormat("Arial",20,0,true); myTextField.defaultTextFormat = myTextFormat; myTextField.text = "test"; myTextField.wordWrap = true; // wordWrap required to put text on two lines /*myTextField.multiline = true; // works even when I comment out multiline */ myTextField.border = true; myTextField.background = true; myTextField.backgroundColor = 0xffffff; myTextField.selectable = false; myTextField.x = 50; myTextField.y = 50; myTextField.height = 60; myTextField.width = 150; addChild(myTextField); addEventListener(Event.ENTER_FRAME, showMouseLocation); function showMouseLocation(myEvent:Event) { myTextField.text = "mouseX:" + mouseX.toString() + " " + "mouseY:" + mouseY.toString(); }