4 Replies Latest reply: Aug 30, 2011 11:58 PM by Mike.Edel RSS

    possible bug in colorTransform related to fullscreen mode (projector and standalone flash player 10)

    Mike.Edel Community Member

      Hi all,

       

      I seem to have hit a bug in the current flash player (tested on 10.1.52.14):

      If I programmatically change the color of a sprite consisting of a text and a circle the output is different if the application is in fullscreen mode (the text is not re-colored in fs)

       

      Inside the mousedown event handler of my class I call the following (somewhat simplified code to make things easier to understand here):

      var cTrans:ColorTransform = new ColorTransform();

      _hColor=0xD78500
      //recolor the clicked sprite
      cTrans.color = _hColor;

      this.transform.colorTransform = cTrans;

       

      This is what I get in windowed mode (expected behavior):Capture_w.PNG

      That's the same sprite in fullscreen:Capture_fs.PNG

      I can switch between windowed and fullscreen and the text gets colored or not as shown above.

       

      Anyone got any clues what's going on? I mean this probably isn't meant to be this way...

      Any (easy) workarounds?

       

      Many thanks,

       

      Mike

        • 1. Re: possible bug in colorTransform related to fullscreen mode (projector and standalone flash player 10)
          Rothrock Community Member

          I've got 10.3.183.5 and I'm not seeing that with this code:

           

          import flash.geom.ColorTransform;

          import flash.display.StageDisplayState;

           

          var home:MovieClip=this;

           

          var s:Sprite=new Sprite();

          var t:TextField=new TextField  ;

          t.selectable=false;

          t.text="Paper";

          t.x=50;

          t.y=50;

           

          s.addChild(t);

          home.addChild(s);

           

          s.graphics.beginFill(0x33a2dd);

          s.graphics.drawCircle(30,30,5);

           

          var cTrans:ColorTransform = new ColorTransform();

          var _hColor:uint=0xD78500;

          cTrans.color=_hColor;

          s.transform.colorTransform=cTrans;

           

          stage.addEventListener(MouseEvent.MOUSE_DOWN,handle);

           

          function handle(e:MouseEvent) {

          if (stage.displayState==StageDisplayState.NORMAL) {

          stage.displayState=StageDisplayState.FULL_SCREEN;

          } else {

          stage.displayState=StageDisplayState.NORMAL;

          }

          }

           

          What do you see with that code?

          • 2. Re: possible bug in colorTransform related to fullscreen mode (projector and standalone flash player 10)
            Mike.Edel Community Member

            Thanks for the answer - that totally reproduces the problem on my side.

            So it seems it's not my fault.

             

            I'm using fscommand(fullscreen, true) to switch to fullscreen at start but that doesn't change anything.

            As I said I'm creating a projector (or start the swf in the standalone flash player) so maybe that's why.

            Manually switching to fullscreen (ctrl+f) also has the same result.

             

            Interesting - I just did some tracing around (in your example after adding the listener)

            //get the current sprite
            var me = Sprite(this.getChildAt(0));
            //get it's first child - the textField
            var _textField = TextField(me.getChildAt(0));
            //output their color transforms
            trace("Sprite cTrans: "+me.transform.colorTransform);
            trace("TF cTrans: "+_textField.transform.colorTransform);

             

            Funny enough the actual textField has a different colorTransform than the sprite itself:

            Sprite cTrans: (redMultiplier=0, greenMultiplier=0, blueMultiplier=0, alphaMultiplier=1, redOffset=215, greenOffset=133, blueOffset=0, alphaOffset=0)
            TF cTrans: (redMultiplier=1, greenMultiplier=1, blueMultiplier=1, alphaMultiplier=1, redOffset=0, greenOffset=0, blueOffset=0, alphaOffset=0)

            As it seems this leads to different colors depending on whether you're in fullscreen or not. Will try also setting that one, too.

            [Update]:
            setting the textField's colorTransform doesn't change anything. Actually, you have to change the sprite's one to see any change.

             

            Cheers,

             

            Mike

            • 3. Re: possible bug in colorTransform related to fullscreen mode (projector and standalone flash player 10)
              Rothrock Community Member

              Well I tried making a projector and didn't see it with that, but then again my install is putting 10.0.22.87 into the projector.

               

              I might try are changing the Sprite to a MovieClip and see if that helps.

              • 4. Re: possible bug in colorTransform related to fullscreen mode (projector and standalone flash player 10)
                Mike.Edel Community Member

                Thanks again for the pointer - I fixed it by updating my projector release and debug player to the latest version (10.3.183).

                Makes sense anyway to get reliable results when targeting both the standalone player and the plugin.

                 

                Cheers,

                 

                Mike