1 Reply Latest reply on Jun 1, 2009 11:20 AM by joan_lafferty

    Panel and Titlewindow when used as a Popup won't style.

    flairjax Level 1

      So I am trying to style a panel and titlewindow, which are used as a popup, but style is not being set. The Style sheet reference is below as well as the popup component.

       

      Style:

      .popUp {
         borderStyle: none;
         titleStyleName: "mypanelTitle";
         cornerRadius: 20;
      }

       

      .mypanelTitle {
         fontSize: 16;
      }

       

      <?xml version="1.0" encoding="utf-8"?>
      <Panel xmlns="http://ns.adobe.com/mxml/2009"
              layout="absolute"
              width="400"
              height="300"
              styleName="popUp">

       

          <Script>
              <![CDATA[
             
                  import mx.events.CloseEvent;
                  import mx.managers.PopUpManager;

       

                  private function titleWindow_close(evt:MouseEvent):void
                  {
                      PopUpManager.removePopUp(this);
                  }
                 
              ]]>
          </Script>
         
          <Declarations>
              <String id="info" source="assets/text/openinginfo.txt" />

       

          </Declarations>

       

          <TextArea id="txt"
                  htmlText="{info}"
                  focusAlpha="0.0"
                  width="100%"
                  height="100%" />
                 
          <!-- Control Bar -->
          <ControlBar horizontalAlign="right" horizontalGap="5" >
              <Button id="panelButton" width="138" label="Close" click="titleWindow_close(event);" />
          </ControlBar>

       


      </Panel>

       

      CODE FROM APPLICATION FILE:

      <script>

       

      private function launchMoreInfo():void {
                      var win:OpeningDialog = PopUpManager.createPopUp(this, OpeningDialog, true) as OpeningDialog;
                      PopUpManager.centerPopUp(win);
                  }

       

      </script>

      <Style source="assets/style/style.css" />

      <Application .... launchMoreInfo(); >

         all other stuff

      </Application>

        • 1. Re: Panel and Titlewindow when used as a Popup won't style.
          joan_lafferty Adobe Employee

          I am assuming that you are using Flex 4 and this does not work. In Flex 4, the default theme used is the "Spark" theme. In Flex 3, we used the "Halo" theme. The Halo theme supports styles like borderStyle, but, the Spark theme does not.

           

          If you want to use these styles, you will need to compile with the Halo theme. You can do this by adding an additional compiler argument -theme=<SDK_DIR>/frameworks/themes/Halo/halo.swc (point to the halo.swc in your SDK installation)

           

          Joan