4 Replies Latest reply on Feb 6, 2009 8:23 AM by SiHoop

    Cannot apply alpha

    SiHoop Level 1
      I'm experimenting with sprites to control a complex text layout. The code below uses a class in which a text field is placed into a sprite. An event listener is used to set the alpha level of the sprite, but it does not work. Commented out is a line to set the scaleY of the same sprite and that does work. The trace statement says that the alpha is 0, but it lies I've tried restarting my machine, but that didn't help. Can anyone provide insight into what is going on?
      Thanks!
        • 1. Re: Cannot apply alpha
          Level 7

          "SiHoop" <webforumsuser@macromedia.com> wrote in message
          news:gmdhb3$r80$1@forums.macromedia.com...
          > I'm experimenting with sprites to control a complex text layout. The code
          > below
          > uses a class in which a text field is placed into a sprite. An event
          > listener
          > is used to set the alpha level of the sprite, but it does not work.
          > Commented
          > out is a line to set the scaleY of the same sprite and that does work. The
          > trace statement says that the alpha is 0, but it lies I've tried
          > restarting my
          > machine, but that didn't help. Can anyone provide insight into what is
          > going on?
          > Thanks!

          Add this line:
          tf0.blendMode='layer';

          HTH;

          Amy


          • 2. Re: Cannot apply alpha
            SiHoop Level 1
            Great, that's perfect. Thank you! But I don't understand why I had to use blendMode. I've used alpha numerous times and never had problems, and the documentation doesn't clarify my problem. Why all of a sudden do I have an issue? Is it something to do with embedding the text fields in sprites?
            • 3. Re: Cannot apply alpha
              Level 7

              "SiHoop" <webforumsuser@macromedia.com> wrote in message
              news:gmerfg$hgd$1@forums.macromedia.com...
              > Great, that's perfect. Thank you! But I don't understand why I had to use
              > blendMode. I've used alpha numerous times and never had problems, and the
              > documentation doesn't clarify my problem. Why all of a sudden do I have an
              > issue? Is it something to do with embedding the text fields in sprites?

              The documentation that text has to be embedded for you to apply any kind of
              alpha setting to it. But setting the blendMode to "layer" tells the player
              to use whatever alpha the object immediately behind it uses.


              • 4. Re: Cannot apply alpha
                SiHoop Level 1
                Thank you!