title: ActionScript: Changing a spark TitleWindow's titlebar color
body: <p>I have a simple doubt. I have made a custom ActionScript mxml component, which is a spark TitleWindow with a text area, which header (titlebar) should display a green background if it finds the word 'success' in its text, or red, if it doesn't.</p>
  
  <p>My problem is that I don't know where to access and modify this property, and the only turnaround I've found is binding the 'chromeColor' of the TitleWindow to depend on a boolean that will change depending on whether I find or not the word 'success'. And this does change the TitleBar background to the color I desire, however, it also changes the scrollbar color, for example, which is a bit nasty. The code for my class is the following: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009" 
             xmlns:s="library://ns.adobe.com/flex/spark" 
             xmlns:mx="library://ns.adobe.com/flex/mx" width="400" 
             title="Output: "
             chromeColor="{success ? ( 0x00ff6b as uint) : ( 0xFF0000 as uint)}"
             close="closeHandler(event)"&gt;
  &lt;fx:Script&gt;
      &lt;![CDATA[
          import mx.events.CloseEvent;
          import mx.managers.PopUpManager;
  
          [Bindable]
          public var success:Boolean = false;
  
          public function setText(text:String):void
          {
              textContainer.text = text;
              if(text.indexOf("SUCCESS")!=-1)
              {
                  success=true;
              }
          }
  
          protected function closeHandler(event:CloseEvent):void
          {
              PopUpManager.removePopUp(this);
          }
  
      ]]&gt;
  &lt;/fx:Script&gt;
  &lt;s:TextArea id="textContainer" x="0" y="0"  width="100%" height="100%"
              paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10" 
              borderVisible="false" editable="false" fontFamily="Courier New"/&gt;
  &lt;/s:TitleWindow&gt;
  </code></pre>
  
  <p>So, thanks for reading, and hope anyone knows the answer :)</p>
  
  <p>Cheers,
  pepillo</p>