One way to achieve this is to extend the Link Button class to display underline on mouse over event.

// code begins

package

{
 import flash.events.MouseEvent;
 
 import mx.controls.LinkButton;

 public class ULinkButton extends LinkButton
 {
  
  public function ULinkButton()
  {
   super();
   this.addEventListener(MouseEvent.MOUSE_OVER, showUnderline)
   this.addEventListener(MouseEvent.MOUSE_OUT, clearUnderline);
  }
  
  
  private function showUnderline(evt:MouseEvent):void
    {
     this.setStyle(“textDecoration”, “underline”);
    }
    
   private function clearUnderline(evt:MouseEvent):void
    {
     this.setStyle(“textDecoration”, “none”);
    }
 }
}

// code ends

The above class extends the the link button component and makes it to listen for mouse over and mouse out events and then sets the textDecoration property to either display underline or not.

Cheers!

Advertisements