1 Reply Latest reply on May 22, 2009 11:10 AM by Flex harUI

    setting unscaled with on class extending LinkButton?

    john isaacks Level 1

      I have a class I made that extends LinkButton so that you can put HTMLText in as the label.

       

      it works but the background/highlist that shows is way too big because the unscalled with is setting as though it is regular text not htmlText, but I cannot override/set the unscaled width because it is private.

       

      Anyone have any ideas?

       

      here is my class:

       

       

      package com.kranichs.components

      {

      import mx.controls.LinkButton;

       

      public class HTMLLinkButton extends LinkButton

      {

      protected var _isHTML:Boolean;

       

      public function HTMLLinkButton()

      {

      super();

      }

       

      [Bindable]

      public function set isHTML(value:Boolean):void

      {

      _isHTML = value;

      }

      public function get isHTML():Boolean

      {

      return _isHTML;

      }

       

      override protected function updateDisplayList(unscaledWidth:Number,

                                                        unscaledHeight:Number):void

              {

              super.updateDisplayList(unscaledWidth, unscaledHeight);

              if(_isHTML)

              {

              textField.htmlText = label;

              }

              }

       

      }

      }