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


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:

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);

function handleOutTarget(evt:MouseEvent):void
    evt.currentTarget.removeEventListener(MouseEvent.MOUSE_OUT, handleOutTarget);
    evt.currentTarget.addEventListener(MouseEvent.MOUSE_OVER, handleOverTarget);

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

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

public function mapTarget(file:Object, stageTF:Object)