4 Replies Latest reply on Feb 26, 2007 11:32 AM by JohnLeger

    Need HELP!

    JohnLeger Level 1
      I have a ColorPicker with an id="myCP" in my homeHBox component that changes the background of my Main Application. I would like to have myTitleWindow change automatically when a new color is selected in myCP.

      I am able to get the selectedColor to be passed to myTitleWindow, but for some reason the default color of the application shows up with in myTitleWindow totally transparent even though the backgroundAlpha of myTitle window is set to 1.0. The code I used to do this is placed in the opening tag of myTitleWindow...

      backgroundColor="{mx.core.Application.application.homeHBox.myCP.selectedColor}"

      I get the same results using...

      backgroundColor="{mx.core.Application.application.homeHBox.myCP.selectedItem}"

      Using the code above the backgroundColor of myTitleWindow will change properly according to the color selected in myCP. The problem is the initial or dafult color of myTitleWindow is transparent and it's not supposed to be. Is this a bug?

      I have also tried to set the initial backgroundColor in the Script Block in my Main.mxml. The code looks I tried is this...

      import mx.core.Application;

      [Bindable] public var myPopUp:TitleWindow;

      public function forgotPasswordTitleWindowDialog():void
      {
      myPopUp = PopUpManager.createPopUp(this, dialogs.forgotPasswordTitleWindow, true)
      as TitleWindow;
      myPopUp.setStyle('background', '#869CA7'); // NOTE: This is the code I added to try and set the default backgroundColor
      PopUpManager.centerPopUp(myPopUp);
      myPopUp.addEventListener("close", closeDialogBox);
      }

      This code correctly sets the default backgroundColor, but then myCP has no effect. When I select a new color in myCP, for a few milliseconds, you see the selectedColor, but then it reverts back to the default color set above.

      Q. How can I have the TitleWindow's backgroundColor by default set to '#869CA7', but the change dynamically when a new color is selected in myCP?

      Thanks,

      John