5 Replies Latest reply on May 21, 2007 6:17 AM by Clark_Kent101

    Alpha property of the Text Control...

    Clark_Kent101
      Hi Everyone,

      Can anyone tell me why the alpha attribute of the Flex 2 Text control doesn't work? I hard coded the alpha value of the Text control to 0 and it still displays the control as if the alpha attribute wasn't set. Is this a bug? Here is an example:

      ----------

      <mx:Text text="testing" color="#ffffff" fontSize="24" width="250" textAlign="center" id="bottomPart" height="100%" alpha="0"/>

      ----------

      Thanks for your time,

      - Tony
        • 1. Re: Alpha property of the Text Control...
          Leoš
          Hi,
          its not bug. I thing you havent embedded font. If you dont want use embed fonts, you can use property visible=false || true
          LK
          • 2. Re: Alpha property of the Text Control...
            Clark_Kent101 Level 1
            Hi Leos,

            Thanks for your prompt response :). I was hoping to use the alpha property to fade in and fade out the text control. Applying the dissolve effect works fine, using the Fade effect however doesn't. I'm using the default font, do I still need to embed font in order to get this working even if I'm using the default font?

            Thanks,

            - Tony
            • 3. Re: Alpha property of the Text Control...
              peterent Level 2
              You still need to use an embedded fonts. Non-embedded fonts are used for performance reasons. The Flash Player doesn't convert characters from those fonts to display text. This is much faster. When you use an embedded font, the player uses vector outlines to form the characters. Thus they can be faded, rotated, etc. but at the cost of speed.
              • 4. Re: Alpha property of the Text Control...
                Leoš Level 1
                Hi,
                you need embed font. If you are using default font = this font isnt embed in Flex/Flash, setting alpha property will have no effect. Fade effect using alpha property. I thing dissolve effect drawing other object, that is over your text/component/whatever and setting alpha property on this new object.
                LK
                • 5. Re: Alpha property of the Text Control...
                  Clark_Kent101 Level 1
                  Awesome, thanks guys - embedding the font worked perfectly.

                  I have one more hurdle that is standing in my way (I suppose I should just start a new topic for this?), what would the syntax be to change the style of a child added to a canvas? Basically I have an mxml component which contains a canvas. That canvas is populated using the addchild method with another mxml component that contains an HBox and a single label. What happens is I add the HBox mxml component to the canvas multiple times - my goal is to change the style of the label within the added mxml component to something else once it has been added to the canvas. I'm not sure what the syntax would be in order to achieve this - I'm thinking along the lines of ' nameOfCanvas.getChildAt(n). ...'.

                  Any idea how I would be able to achieve this?

                  Thank you both for your time and help,

                  - Tony