1 Reply Latest reply: Jul 19, 2013 6:11 AM by Craberoid RSS

    how to add a skinpart to an inline component?

    KentWood2012 Community Member

      hi

      i was try to create a simple skinable component,and in its skin,i add create an inline component

      skin mxml code like this

       

      <fx:Declarations>
      <!--define an inline component -->
          <fx:Component className="RedRect">
        <s:Group>
        <s:Rect width="12" height="12" x="-6" y="-6" >
        <s:stroke>
        <s:SolidColorStroke color="0xff0000" />
        </s:stroke>
        </s:Rect>
      </s:Group>
        </fx:Component>
      <!--use that inline component -->
      <local:RedRect id="myRedRect"  />
      </fx:Declarations>
      

       

      but i've no idea how to define the component "myRedRect" in my skinable component as file

       

      [Skinpart(type="spark.components.Group")]

      public var myRedRect:IFactory

       

      can't work...

       

      can someone give a clear anwser plz?

       

      PS:if i can't use incline component,finally,i have to define a new component outside,i really don't wanna add more mxml files