2 Replies Latest reply on Mar 31, 2010 12:11 PM by Bibi0401

    styleName with Flex 4 SDK

    Bibi0401

      Hello,

      I have a question regarding the use of the styles

      I am french and i am starting on Flex, so please excuse my poor english

       

      I downloaded the last release of the Flex SDK and compiled a small application in command line

      This is the code source :

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application name="Spark_List_HScrollBar_styles_test"
              xmlns:fx="http://ns.adobe.com/mxml/2009"
              xmlns:s="library://ns.adobe.com/flex/spark"
              xmlns:mx="library://ns.adobe.com/flex/halo">
       
          <fx:Style>
              @namespace s "library://ns.adobe.com/flex/spark";
       
              s|List {
                  baseColor: red;
              }
          </fx:Style>
       
          <fx:Declarations>
              <s:ArrayList id="arrList">
                  <fx:Object label="The quick brown fox jumps over the lazy dog" />
                  <fx:Object label="One" />
                  <fx:Object label="Two" />
                  <fx:Object label="Three" />
                  <fx:Object label="Four" />
                  <fx:Object label="Five" />
                  <fx:Object label="Six" />
                  <fx:Object label="Seven" />
                  <fx:Object label="Eight" />
                  <fx:Object label="Nine" />
              </s:ArrayList>
          </fx:Declarations>
       
          <s:HGroup horizontalCenter="0" verticalCenter="0">
              <s:List id="list1"
                      dataProvider="{arrList}"
                      width="100" height="100" />
              <s:List id="list2"
                      dataProvider="{arrList}"
                      width="100" height="100" />
              <s:List id="list3"
                      dataProvider="{arrList}"
                      width="100" height="100" />
          </s:HGroup>
       
      </s:Application>
      

       

      It compiled without errors, but it seems that the style I associated to the List element is not applied (I have the same problem when I try to use the styleName attribute instead of <fx:Style>)

      Do you know why ?

        • 1. Re: styleName with Flex 4 SDK
          Peter deHaan Level 4

          I believe baseColor was deprecated in favor of chromeColor.

           

          function(){return A.apply(null,[this].concat($A(arguments)))}

          <?xml version="1.0" encoding="utf-8"?>
          <s:Application name="Spark_List_HScrollBar_styles_test"
                  xmlns:fx="http://ns.adobe.com/mxml/2009"
                  xmlns:s="library://ns.adobe.com/flex/spark"
                  xmlns:mx="library://ns.adobe.com/flex/mx">
             
              <fx:Style>
                  @namespace s "library://ns.adobe.com/flex/spark";
                 
                  s|List {
                      chromeColor: red;
                      symbolColor: haloGreen;
                      contentBackgroundColor: haloBlue;
                  }
              </fx:Style>
             
              <fx:Declarations>
                  <s:ArrayList id="arrList">
                      <fx:Object label="The quick brown fox jumps over the lazy dog" />
                      <fx:Object label="One" />
                      <fx:Object label="Two" />
                      <fx:Object label="Three" />
                      <fx:Object label="Four" />
                      <fx:Object label="Five" />
                      <fx:Object label="Six" />
                      <fx:Object label="Seven" />
                      <fx:Object label="Eight" />
                      <fx:Object label="Nine" />
                  </s:ArrayList>
              </fx:Declarations>
             
              <s:HGroup horizontalCenter="0" verticalCenter="0">
                  <s:List id="list1"
                      dataProvider="{arrList}"
                      width="100" height="100" />
                  <s:List id="list2"
                      dataProvider="{arrList}"
                      width="100" height="100" />
                  <s:List id="list3"
                      dataProvider="{arrList}"
                      width="100" height="100" />
              </s:HGroup>
             
          </s:Application>


          Peter

          • 2. Re: styleName with Flex 4 SDK
            Bibi0401 Level 1

            Thank you very much !