0 Replies Latest reply on Jul 31, 2009 7:14 PM by HeatherZh

    With Gumbo how to set default styles for actionscript custom components ?

    HeatherZh Level 1

      I was migrating a working Flex app from Flex 3.4 to Gumbo and encountered a bunch of run-time errors.  The errors are occuring because the default styles for some of actionscript custom components are not longer set.

       

      Based on livedocs (link below), under "settng default values" subtitle, there is no change between Flex 3 and Gumbo on how this should be done.

       

      http://livedocs.adobe.com/flex/gumbo/html/WS2db454920e96a9e51e63e3d11c0bf687e7-7ff6.html#W S2db454920e96a9e51e63e3d11c0bf69084-79d9

       

      But I am having trouble to get the example in the livedocs working.  I copied and pasted StyledRectangle.as, and the exact same mxml as in the livedocs

       

      <code>

      <?xml version="1.0"?> 
      <!-- skinstyle\MainRectNoStyles.mxml -->
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/halo"
          xmlns:MyComp="myComponents.*">
          <s:layout>
              <s:VerticalLayout/>
          </s:layout>
          <MyComp:StyledRectangle/>   
              <!-- By default, use the style defined by the CSS type selector. -->
          <MyComp:StyledRectangle id="mySR1"/>  
      </s:Application>
      </code>

      and run the project, no rectangle is rendered at all (alphasData is null).

      However, if I add
      <code>
          <fx:Style>
              @namespace "myComponents.*";
              StyledRectangle {fillColors: #FF00FF, #00FFFF}
          </fx:Style>
      </code>
      I least rectangles are showing up (alphasData is still null though).

      What is the correct way to set default styles for an actionscript custom component using Gumbo ?
      I have tried various version of SDK and the results are identical so far.  The latest SDK I tried is 4.0.0.8847

      Any help is very much appreciated!
      Heather