# I need some serious help with a hover problem. Higher level stuff

**URL:** <https://forum.kirupa.com/t/i-need-some-serious-help-with-a-hover-problem-higher-level-stuff/325746>\
**Category:** Uncategorized\
**Created:** [November 2, 2011, 8:09pm UTC](https://forum.kirupa.com/t/i-need-some-serious-help-with-a-hover-problem-higher-level-stuff/325746 "2011-11-02T20:09:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![m2244](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@m2244](https://forum.kirupa.com/u/m2244)\
**Post date:** [November 2, 2011, 8:09pm UTC](https://forum.kirupa.com/t/i-need-some-serious-help-with-a-hover-problem-higher-level-stuff/325746/1 "2011-11-02T20:09:03Z")

</div>

Hello,

So, I have this AIR application in which an object can be created on the stage. When you hove over this object a textfield off to the left shows the object’s name. When you move the mouse out the name goes away. Easy. You can also draw a line from one of these objects to another. This is where I use a class file to record where the line was draw to and from.

In doing so I had to pass the name textfield as an object to the class. Then if you erase the line, that hover-to-get-the-name feature does not work anymore. Did passing the object and the textfield somehow disable the hover eventlistener?

I realize that this description might be hard to follow but I need help. This might require posting all of my code.

Here is some of the code:

```auto

file.tracking=new mapTarget(file,txtChoiceLabels);

function handleOverTarget(evt:MouseEvent):void
{
    evt.currentTarget.removeEventListener(MouseEvent.MOUSE_OVER, handleOverTarget);
    evt.currentTarget.addEventListener(MouseEvent.MOUSE_OUT, handleOutTarget);
    evt.currentTarget.parent.tracking.displayLabelData(evt.currentTarget);
}

function handleOutTarget(evt:MouseEvent):void
{
    evt.currentTarget.removeEventListener(MouseEvent.MOUSE_OUT, handleOutTarget);
    evt.currentTarget.addEventListener(MouseEvent.MOUSE_OVER, handleOverTarget);
    txtChoiceLabels.text="";
}

```

Some code from the class file where the textfield is passed as an object

```auto

public var fileRef:Object;
public var labelTextField:Object;

public function mapTarget(file:Object, stageTF:Object)
    {
        fileRef=file;
        labelTextField=stageTF;
    }

```
