0

I have a sprite-container with some formatted text in it. I know that I can change its color via TextFormat, but a container is quite handy since I put many text fields in it, and I can change their color with a single command.

  var textContainer:Sprite =  new Sprite();
  addChild(textContainer);

  var format:TextFormat = new TextFormat();
  format.size = 12;
  format.font = "Arial";

  var someText:TextField = new TextField();
  someText.defaultTextFormat = format;          
  someText.text = "ABC";            
  textContainer.addChild(someText);

  var colorTransform:ColorTransform = new ColorTransform();
  colorTransform.color = 0xFF0000; 
  textContainer.transform.colorTransform = colorTransform;

Now when I test in the Flash player, the color changes properly. Instead, when I publish in HTML, for some reason the color doesn't change.

Where I'm wrong?

4
  • Sounds like maybe you're just running into a caching issue in your browser, try to delete the bin-debug folder, refresh to see that things are gone, run a clean build and check again. Jun 6, 2013 at 19:36
  • I noticed this happens only with Chrome. IE works fine. Any help?
    – LeeFX
    Jun 7, 2013 at 8:00
  • Problem solved! :) Take a look here: helpx.adobe.com/flash-player/kb/…
    – LeeFX
    Jun 7, 2013 at 8:11
  • Ah so the issue was ultimately the internal version of flash player used by chrome has a bug in it at the moment. It might be worthwhile to search for if the bug has been entered yet on Adobe's end or with Chrome. Jun 7, 2013 at 20:51

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.