2 Replies Latest reply on Jul 6, 2010 3:03 AM by YKaura

    Urgent:Creating stylesheet in flex

    YKaura

      Hi,

      I am having a problem.

      I have defined an external stylesheet and use it in my application.

      The stylesheet contains styles for a panel.

      However, I do not want to use external stylesheet since I want to componentize the panel.

      So, I want to use internal styles.

      But, when I do so the rendering is not the same.

      Here is the sample code

             setStyle("paddingTop","31px");
              setStyle("paddingLeft","10px");
              setStyle("paddingRight","10px");
              setStyle("paddingBottom","10px");
              setStyle("roundedBottomCorners",false);
              setStyle("borderThickness","1px");
              setStyle("borderStyle","solid");
              setStyle("borderColor","0x999999");
              setStyle("headerColors",["0xcccccc","0x999999"]);
              setStyle("highlightAlphas",[0.9,0]);
              setStyle("backgroundColor","0xffffff");
             
              setStyle("headerHeight","22px");
              setStyle("shadowDirection","right");
              setStyle("dropShadowColor","0x999999");

       

       

      And the stylesheet is as follows

      pd|Pod
      {
          padding-top: 31px;
          padding-left: 10px;
          padding-right: 10px;
          padding-bottom: 10px;
          rounded-bottom-corners: false;
          border-thickness: 1px;
          border-style: solid;
          border-color: #999999;
          header-colors: #cccccc, #999999;
          highlight-alphas: .9, 0;
          background-color: #ffffff;
          corner-radius: 6px;
          header-height: 22px;
          shadow-direction: right;
          drop-shadow-color: #999999;
      }

       

      Also, the style  corner-radius: 6px; gives a InvalidBitMapData in my actionscript file.what should I do?

       

      Any help will be highly appreciated

       

      Warm Regards,

      Yukti

        • 1. Re: Urgent:Creating stylesheet in flex
          BhaskerChari Level 4

          Hi Yukti,

           

          You are using the style properties wrongly....

           

          setStyle("paddingTop",31);
                  setStyle("paddingLeft",10);
                  setStyle("paddingRight",10);
                  setStyle("paddingBottom",10);
                  setStyle("roundedBottomCorners",false);
                  setStyle("borderThickness",1);
                  setStyle("borderStyle","solid");
                  setStyle("borderColor",0x999999);
                  setStyle("headerColors",[0xcccccc,0x999999]);
                  setStyle("highlightAlphas",[0.9,0]);
                  setStyle("backgroundColor",0xffffff);
                 
                  setStyle("headerHeight",22);
                  setStyle("shadowDirection","right");
                  setStyle("dropShadowColor",0x999999);

           

          Use the above styles and test it and let me know...


          If this post answers your question or helps, please kindly mark it as such.


          Thanks,

          Bhasker Chari

          • 2. Re: Urgent:Creating stylesheet in flex
            YKaura Level 1

            Thanks Bhaskar.Really hepful.