4 Replies Latest reply on Dec 29, 2010 11:49 PM by Sible99

    missing "disabled" state in skin

    Sible99 Level 1

      I have a custom component CircleProgress.mxml with two states: "default" and "other", using a skin with the same two states defined. But during compilation, there appears an error in the skin file: The required skin state "disabled" is missing.

       

      I don't want any "disabled" state because the logic of my application does not include such state. How to get rid of this error? (without adding the "disabled" state)

       

      Below is the code:

       

      <s:BorderContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
                         xmlns:s="library://ns.adobe.com/flex/spark"
                         xmlns:mx="library://ns.adobe.com/flex/mx"
                         skinClass="mylib.progress.circle.skins.SolidSkin"
                         >
          <s:states>
              <s:State name="default"/>
              <s:State name="other"/>
          </s:states>
          <fx:Script>
              <![CDATA[
                  import mx.events.FlexEvent;
                  import spark.components.supportClasses.SkinnableComponent;
                  import spark.primitives.Ellipse;
                 
                  [SkinState("default")]
                  [SkinState("other")]
             
                  [SkinPart(required="true")]
                  public var skinCircle:Ellipse;

              ]]>
          </fx:Script>
      </s:BorderContainer>

       

      And the skin:

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:Skin 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:Metadata>
              [HostComponent("mylib.progress.circle.CircleProgress")]
          </fx:Metadata>
          <s:states>
              <s:State name="default" />
              <s:State name="other" />
          </s:states>
          <s:Ellipse id="skinCircle" width="100%" height="100%"    >
              <s:stroke>
                  <s:SolidColorStroke color="blue"/>
              </s:stroke>
          </s:Ellipse>
      </s:Skin>