9 Replies Latest reply on Dec 7, 2007 5:48 PM by doug777

    TitleWindow transparency

    TheJadeStorm
      Howdy! I'm having issues killing transparency in a TitleWindow. I've tried everything I can think of and nothing seems to "take". I'm out of ideas on how to approach it. So I'm hoping to start a dialog here that might lead me in the right direction. What would you need to know form me about the TitleWindow in question? Is transparency default? Where should I look to try to trace it? Sorry for the lack of info but I'm out of ideas to a point where I don't know where to start to tell you why it might not be working. =) Thanks!
        • 1. Re: TitleWindow transparency
          atta707 Level 2
          have you tried alpha property?

          ATTA
          • 2. Re: TitleWindow transparency
            doug777 Level 1
            I think it's myTitleWindow.setStyle("borderAlpha", "1");

            Doug
            • 3. Re: TitleWindow transparency
              TheJadeStorm Level 1
              Unfortunately, yes. =( In a number of ways. I just tried every iteration of alpha I can think of. Including:

              _popup = UserSearchWindow(PopUpManager.createPopUp(SparkManager.contactListContainer, UserSearchWindow, false));
              _popup.setStyle("borderAlpha", "1");
              _popup.setStyle("modalTransparency", "1");
              _popup.setStyle("alpha", "1");
              _popup.setStyle("backgroundAlpha", "1");

              and

              <mx:TitleWindow
              xmlns:mx=" http://www.adobe.com/2006/mxml"
              color="white" titleIcon="@Embed(source='/assets/images/tiny-search.png')"
              title="User Search" showCloseButton="true" close="close()"
              creationComplete="init()" borderAlpha="1" backgroundAlpha="1" alpha="1">

              No go, seems to affect nothing. =( I believe we are using the 3.0 beta 2 SDK. Any chance it's busted on that front?

              The following link goes to a screenshot of what the window currently looks like, over top of another window to help illustrate the transparency:
              http://www.vorpalcloud.org/~daniel/transwindow.png
              • 4. Re: TitleWindow transparency
                doug777 Level 1
                I'm sure the one you want is borderAlpha.

                I haven't tried this, but it might be worth a go, just in case the layout manager completes before the setStyle takes effect.

                import mx.events.FlexEvent;

                _popup.addEventListener(FlexEvent.CREATION_COMPLETE, initStyle);

                private function initStyle(event:FlexEvent):void{
                //try with setStyle where it is now and try it with it here
                _popup.validateDisplayList();
                }

                I also have some problems with setStyle and would be interested to hear if this works or not.

                Doug
                • 5. Re: TitleWindow transparency
                  TheJadeStorm Level 1
                  Unfortunately, it didn't help. =( (crap I really thought that was going to do it!)
                  I think I've narrowed down the overall "whats causing it" though, in terms of... our style sheet is doing it somehow. Thing is, I don't know why. But basically, if I wipe our style sheet clean and then make mods to the TitleWindow, they take. If I leave the style sheet in place, somehow that's "winning". I don't yet understand what in the style sheet is causing it. Nothing "makes sense". =/
                  • 6. Re: TitleWindow transparency
                    m_hartnett Level 3
                    Here is my css for all TitleWindows. The attribute that is causing the transpanency is background-alpha.
                    TitleWindow{
                    color : #0f3177;
                    title-style-name : “alertTitle”;
                    header-height:19;
                    border-thickness: 1;
                    drop-shadow-enabled: true;
                    drop-shadow-color :#d1ddf7;
                    background-color: #def9fe;
                    corner-radius :3;
                    border-style :solid;
                    header-colors : #90a4d1, #5970a0;
                    footer-colors : #9db6d9, #ffffff;
                    border-color : #5970a0;
                    background-alpha : 1;
                    }
                    • 7. Re: TitleWindow transparency
                      doug777 Level 1
                      I don't think the problem is the backgroundAlpha, because its default value is 1 anyway, and what else could borderAlpha be for? Also borderAlpha's default value is 0.4 which looks about right for what you see.

                      However, I do like the idea of the borderStyle. Could it be that this has to be "solid" before backgroundAlpha can take effect. Its default is null.

                      Forget the creationComplete stuff and just go back to the original, but try this:

                      _popup.setStyle("borderStyle", "solid");
                      _popup.setStyle("borderAlpha", "1");

                      Again, please let me know the result.

                      Another possibility is borderSkin. The default value of this is mx.skins.halo.HaloBorder. So you could also try adding:

                      _popup.setStyle("borderSkin", "null");
                      _popup.setStyle("borderColor", "0x000000");//or whatever color you want

                      Good luck,
                      Doug
                      • 8. Re: TitleWindow transparency
                        TheJadeStorm Level 1
                        Hi Doug! Generally you had the right idea there. =) I couldn't get null to "take". (nothing liked it) However, the following set on the TitleWindow style successfully overroad what was going on. I'll get to that in a moment..

                        borderSkin: ClassReference("mx.skins.halo.PanelSkin");
                        borderColor: #5E5851;
                        borderAlpha: 1;
                        backgroundColor: #5E5851;
                        backgroundAlpha: 1;

                        I probably didn't need all of that, but I did it anyway. ;) So basically, we have a borderSkin set on Panel, and TitleWindow is a subset of Panel, and it appears to carry. There doesn't appear to be an easy way of overriding it aside from setting a different skin. The skin itself doesn't appear to do anything specific for TitleWindows, so oh well. =/ I found this:

                        http://www.swftools.org/

                        To be extremely useful btw. I was able to dump info from the .swf skin file and at least gather some info. =D
                        • 9. Re: TitleWindow transparency
                          doug777 Level 1
                          That's great! Thanks for the info.
                          Doug