jenniferma
11-25-2008, 10:18 AM
I have this dynamically loaded text fields, I have added listeners to each of them for MOUSE_OVER, MOUSE_OUT and MOUSE_DOWN events. when MOUSE_OVER the text would change color and when MOUSE_OUT it would change back to its original color. What I intend to do is when I click on it, it should change its color and stop respond to MOUSE_OVER and MOUSE_OUT events until I make a click on other text fields and it will come back alive to respond to MOUSE_OVER and MOUSE_OUT events while the other text field later clicked will stop responding to MOUSE_OVER and MOUSE_OUT.
How should I achieve this?
So far I could only make colors change in MOUSE_OVER and MOUSE_OUT events, but could not make the text color to stay unchanged when clicked.
Here's a fraction of my code:
function mouseOverText(e:MouseEvent):void {
trace("mouseOverText: ", e.target);
TextField(e.target).textColor = 0xFF0000;
}
function mouseOutText(e:MouseEvent):void {
trace("mouseOutText: ", e.target);
TextField(e.target).textColor = 0x00FF00;
}
function mouseClickText(e:MouseEvent):void {
TextField(e.target).textColor = 0xFF0000;
trace("mouseClickText", e.target.name);
LoadExternalImage(e.target.name);
}
How should I achieve this?
So far I could only make colors change in MOUSE_OVER and MOUSE_OUT events, but could not make the text color to stay unchanged when clicked.
Here's a fraction of my code:
function mouseOverText(e:MouseEvent):void {
trace("mouseOverText: ", e.target);
TextField(e.target).textColor = 0xFF0000;
}
function mouseOutText(e:MouseEvent):void {
trace("mouseOutText: ", e.target);
TextField(e.target).textColor = 0x00FF00;
}
function mouseClickText(e:MouseEvent):void {
TextField(e.target).textColor = 0xFF0000;
trace("mouseClickText", e.target.name);
LoadExternalImage(e.target.name);
}