1 Reply Latest reply on Aug 14, 2009 4:50 PM by Flex harUI

    Des it have to be so hard?

    Zolotoj Level 3

      I have created a custom renderer based on LinkButton:

      package modulecode
      {
           import flash.text.TextLineMetrics;     
           import mx.controls.LinkButton;     
           public class linkButtonWordWrap extends LinkButton
           {
                public function linkButtonWordWrap()
                {
                     super();
                }
                override protected function createChildren():void
                {
                     super.createChildren();
                     if (textField)
                     {
                         textField.wordWrap = true;
                         textField.multiline = true;
                     }
                }     
                override public function set data(value:Object):void
                {
                     super.data = value;
                     label = value.link.substr(10);
                }     
                override public function measureText(s:String):TextLineMetrics
                {
                     textField.text = s;
                     var lineMetrics:TextLineMetrics = textField.getLineMetrics(0);
                     lineMetrics.width = textField.textWidth;
                     lineMetrics.height = textField.textHeight;
                     return lineMetrics;
                }
      
           }
      }
      

      I am also trying to create a custom renderer based on textArea:

      package
      {
           import mx.controls.listClasses.IDropInListItemRenderer;
           
           import spark.components.TextArea;
      
           public class customTextArea extends TextArea
           {
                public function customTextArea()
                {
                     super();
                }
                override public function set data(value:Object):void
                {
                     super.data = value;
                     text = value.docdescript;
                     editable = value.link != '' ? true : false;
                }
           }
      }
      

      but here it is not taking override public function set data(value:Object):void.

      Description Resource Path Location Type

      1020: Method marked override must override another method. customTextArea.as

      Why? Why it's not working in the same way as my LinkButton code?