Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detecting mouse events on a text box 1

Status
Not open for further replies.

ugly

Programmer
Jul 5, 2002
70
GB
I'm trying to detect mouse over and mouse down events but ONLY when the mouse cursoris positioned directly over a text box called "text1". I get feedback through a textbox called
"feedback". This code gives me feedback no matter where I am positioned, I want it only when the mouse is over the text box-thanks for any advice

onMouseMove = function () {
feedback.text = "You are moving on the text box";
};
onMouseDown = function () {
feedback.text = "You clicked on the textbox component";
};

myListener = new Object();
text1.addListener(myListener);
 
Nest the textfield in a movie clip, or overlap a movie clip on the textfield, and use a hitTest on the movie clip, to detect when the mouse is over the textfield.
You can also add an onRelease handler on that movie clip, or add an invisible button inside of it, to detect if the textfield was clicked upon...

Regards. Web Hosting - Web Design
03/13/05 -> OLDNEWBIE VS FLASHKIT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top