# Bug? or functioning as intended?

**URL:** <https://forum.kirupa.com/t/bug-or-functioning-as-intended/327583>\
**Category:** flash\
**Created:** [March 11, 2012, 7:45pm UTC](https://forum.kirupa.com/t/bug-or-functioning-as-intended/327583 "2012-03-11T19:45:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oddeye](https://avatars.discourse-cdn.com/v4/letter/o/90ced4/32.png) [@Oddeye](https://forum.kirupa.com/u/Oddeye)\
**Post date:** [March 11, 2012, 7:45pm UTC](https://forum.kirupa.com/t/bug-or-functioning-as-intended/327583/1 "2012-03-11T19:45:19Z")

</div>

Hi,

I have a TLF Read-Only Textbox. I have given the text box an instance name and attached a MOUSE\_OVER and MOUSE\_OUT listener to it.

On mouse over: Displays a value with the .text property.  
On mouse out: Sets the .text property to “”

The textbox functions correcty as I move the mouse onto the textbox area; a value is displayed. However, if I hover the mouse over the actual value, the mouse over and mouse out listeners get activated repeatedly in sequence. Is this a bug with AS3/cs5? Is there a way around this?

Here is some of the relevant code (from different classes):

\*\*\_gameModel.\_UI.textbox2.addEventListener(MouseEvent.MOUSE\_OVER,onMouseOver);  
\_gameModel.\_UI.textbox2.addEventListener(MouseEvent.MOUSE\_OUT,onMouseOut);  
\*\*  
\*\*private function onMouseOver(event:MouseEvent):void  
{  
\_gameController.processMouseOver(event);  
}  
\*\*  
\*\*private function onMouseOut(event:MouseEvent):void  
{  
\_gameController.processMouseOut(event);  
}  
\*\*  
\*_public function processMouseOver(event:Event)  
{  
\_gameModel.onesTotal=0;  
for(var i:int=0;i\<\_gameModel.diceArray.length;i++)  
{  
if(\_gameModel.diceArray_.Value==1)  
{  
\_gameModel.onesTotal=\_gameModel.onesTotal+1;  
}  
}  
\_gameModel.\_UI.textbox2.text=\_gameModel.onesTotal;  
}  
\*\*  
\*\*public function processMouseOut(event:Event)  
{  
\_gameModel.\_UI.textbox2.text="";  
}  
\*\*  
Thanks in advance,

Anthony C.
