Skip to main content
Known Participant
May 12, 2010 12:12 PM UTC
Question

Tooltip to link elements

Hello

I am trying to attaching tooltips to the link elements in my text flow.I added the roll over event listener with the link element and then trying to display the href of link element in the tool tip.

The problem is when I am trying to get the particular link element over which the mouse is rolling as evt.currentTarget as linkElement,it is null.When I try to check it using trace, the output was [Object eventDispatcher]. I am writing the few effect related lines of my code:

linkElement.addEventListener(MouseEvent.ROLL_OVER,applyToolTipToLink);

and after adding event, I am creating tooltip using

private function applyToolTipToLink(evt:Event):void{

     var linkElem:LinkElement = evt.currentTarget as LinkElement;

     spriteToolTip = ToolTipManager.createToolTip(linkElem.href,this.mouseX + 10,this.mouseY)as ToolTip;

}

Doesn't meet the required results and exception arise is "Cannot access a property or method of a null object reference."

Any Solution.

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

Known Participant
May 13, 2010 10:16 AM UTC

hi

     In applyToolTipToLink method use "evt.flowElement" instead of  "evt.currentTarget".

Translate
Known Participant
May 13, 2010 11:12 AM UTC

Thats work great

thanks.

Translate
Known Participant
May 13, 2010 4:48 AM UTC

Hi

Any Solution?

Translate