2 Replies Latest reply on Dec 22, 2006 11:16 AM by ntsiii

    Setting the style of a label

    xyco45 Level 1
      a few complete examples on how to do this... setting its color, font size, etc...


      thanx a bunch!
        • 1. Setting the style of a label
          Hugo_Core Level 1
          Hi xyco45,

          On a Label component you can aply style preety easy by the Design mode of Flex Builder, by the Code mode, or by a CSS style. I leave you with some simple samples.

          Code Mode:

          <mx:Label text="Sample Text" fontFamily="Georgia" fontSize="36" color="#004000" fontWeight="bold" textAlign="right"/>

          CSS Mode (Best to keep your Apl. uniform and easy modification) :
          #Define the style's
          #Here you can use real CSS sintax's or the style's sintax from flex like in the sample in the code mode.

          <mx:Style>

          .youStyeName {
          color: #FFFFFF;
          font-size: 24;
          }

          </mx:Style>

          Then you say to the Label to use this Style by the styleName prop :

          <mx:Label text="Sample Text" styleName="youStyeName"/>

          Hope i Help,
          Core . Regards

          • 2. Re: Setting the style of a label
            ntsiii Level 3
            Excellent examples, Core!

            xyco45, consider marking Core's post as a solution if it works for you.

            Tracy