3 Replies Latest reply on Aug 26, 2009 12:58 PM by PropWash

    Label properties and custom class

    PropWash Level 1

      I want to make the following persistent: <mx:Label useHandCursor="true" buttonMode="true" mouseChildren="false" />

      I have tried to create a custom class that extends the Label class, but can't get the syntax right.

      override protected ???

      buttonMode=true;

      I don't think that I want to override a function.  It seems to me that I want to override a property or attribute of the Label class.

      Can anyone give me any guidance?

        • 1. Re: Label properties and custom class
          Virat Patel Level 2

          Hi

           

          As you need Lable with default property {  useHandCursor="true" buttonMode="true" mouseChildren="false" }

           

          I have extend the Label you can do it in directly in constructor by setting the value

           

          ------------- Custom Label Class ----------------------------------

           

          package
          {
              import mx.controls.Label;

           

              public class CusLbl extends Label
              {
                  public function CusLbl()
                  {
                      super();
                      super.buttonMode = true;
                      super.useHandCursor = true;
                      super.mouseChildren = false;
                  }
                 
              }
          }

           

          --------------------------------------------------------------------------------

           

          You can directly use in application or in any other container with default property;

           

          Ckeck attached file if needed.

           

          With Regards

          Virat Patel

          • 2. Re: Label properties and custom class
            PropWash Level 1

            That works perfectly!  Thank you very much!

            • 3. Re: Label properties and custom class
              PropWash Level 1

              Virat,

               

              Your solution worked perfectly.  Thank you very much.  I appreciate your prompt response and help.

               

              Gary