1 Reply Latest reply on Dec 10, 2012 4:51 PM by roymeo_

    CacheAsBitmap and setting Alpha?

    JAXIMFLASH Level 1

      I am experiencing a problem with setting the cacheAsBitmap and alpha properties on TV devices. (This is not an issue on my desktop.)

       

      I'd like to set a display object's cacheAsBitmap property to true.

      The display object has an alpha transparency of .5.

       

      If I cache the Bitmap while the alpha is set to .5, then the display object appears to have a transparency of .25.

       

      I've tried to set the alpha to 1, cache the bitmap, and then set the alpha to .5 --  this does not work.

      this.alpha = 1;

      this.cacheAsBitmap = true;

      this.alpha = .5;

       

       

      What does work is if I delay in setting the alpha. If i set the alpha to 1, cache the bitmap, wait 2 seconds, and then set the alpha to .5 --- then that works!


      this.alpha = 1;

      this.cacheAsBitmap = true;

      var timer:Timer = new Timer(2000,1);

      timer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimer);

      timer.start();

       

      protected function onTimer(e:TimerEvent):void {

                                    this.alpha = .5;

      }


       

      However, this is less than ideal. I want to cache the bitmap immediately while the alpha is set to .5.

      Is there some trick to do this?