7 Replies Latest reply on Aug 10, 2010 4:37 PM by kglad

    Color not be seen...

    Ron Colmen Level 2

      I'm using the cade below to capture something in a mc. But whenever there text in color it captures the text in WHITE.... (if the mc had red text the capture image shows white text) why is that? Where can the issue be?

       

      my_btn.onRelease = function() {

      var bmd:BitmapData = new BitmapData(100,75);

      var mat:Matrix=new Matrix();

      mat.a=mat.d=2;

      bmd.draw(_root.abc_mc,mat);

      holder4.attachBitmap(bmd,1);

      _root.book_mc.attachBitmap(bmd,1)

      };

        • 1. Re: Color not be seen...
          kglad Adobe Community Professional & MVP

          i don't see that.

          • 2. Re: Color not be seen...
            Ron Colmen Level 2

            I believe it has to do something with the colurchange function. Coz when I set the text field color using the properties in flash, it captures that color correctly. But when I use the below script to change the text field color then the capture shows white (which the color set for the text field using the properties in flash). How can I overcome this?

             

            var mcA:Array = [_root.text1, _root.text2];

             

            green_btn.onRelease = function(){

            for (var i:Number = 0; i<mcA.length; i++) {

                colorChangeF(mcA[i],0x33FF00);

            }

             

            red_btn.onRelease = function(){

            for (var i:Number = 0; i<mcA.length; i++) {

                colorChangeF(mcA[i],0xFF0000);

            }

             

            function colorChangeF(mc:MovieClip, col:Number):Void {

                mc.c = new Color(mc);

                mc.c.setRGB(col);

            }

            • 3. Re: Color not be seen...
              kglad Adobe Community Professional & MVP

              the draw method copies the "untransformed" movieclip to the bitmapdata object.  ie, it copies the movieclip as it appears in your library and reflects no dynamic changes.

               

              so, what you're seeing is expected behavior.

              • 4. Re: Color not be seen...
                Ron Colmen Level 2

                What can I do to capture the text color when it's different to white?

                 

                Thank you.

                • 5. Re: Color not be seen...
                  kglad Adobe Community Professional & MVP

                  record the changes you're making with a variable.

                  • 6. Re: Color not be seen...
                    Ron Colmen Level 2

                    Could you show me how it should be done?

                    • 7. Re: Color not be seen...
                      kglad Adobe Community Professional & MVP

                       

                       

                      var mcA:Array = [_root.text1, _root.text2];

                       

                      green_btn.onRelease = function(){

                      for (var i:Number = 0; i<mcA.length; i++) {

                          colorChangeF(mcA[i],0x33FF00);

                      }

                       

                      red_btn.onRelease = function(){

                      for (var i:Number = 0; i<mcA.length; i++) {

                          colorChangeF(mcA[i],0xFF0000);

                      }

                       

                       

                      function colorChangeF(mc:MovieClip, col:Number):Void {

                          mc.c = new Color(mc);

                          mc.c.setRGB(col);

                      mc.col = col;  // now each movieclip knows the rgb that's been used to transform it.

                      }