2 Replies Latest reply on Oct 2, 2010 5:32 AM by septCinquante

    add public var to skin class

    septCinquante

      hello

      i'm new with sdk 4

      i have a problem with skin class , i'll go creazy ;-)

       

      i wouldlike pass data to my instance skin class , for example i wouldlike get "test"

       

      my skin class :

      <?xml version="1.0" encoding="utf-8"?>
      <s:Skin xmlns:s="library://ns.adobe.com/flex/spark"
              xmlns:fx="http://ns.adobe.com/mxml/2009"
              xmlns:components="components.*"
             >
          <fx:Metadata>[HostComponent("spark.components.SkinnableContainer")]</fx:Metadata>
         
          <fx:Script>
              <![CDATA[
                 
                  [Bindable]
                  public var test :Object;
                 
                
              ]]>
          </fx:Script>
          <s:states>
              <s:State name="normal"/>
              <s:State name="disabled"/>
          </s:states>
          <s:Rect height="312" radiusX="10" width="449" x="2.5" y="2.5">
              <s:stroke>
                  <s:SolidColorStroke caps="none" color="#5380D0" joints="miter" miterLimit="4" weight="5"/>
              </s:stroke>
              <s:fill>
                  <s:SolidColor color="#AF0000"/>
              </s:fill>
          </s:Rect>
          <s:Label>
             
          </s:Label>
          <s:VScrollBar height="200" width="15" x="231" y="98" viewport="{contentGroup}"/>
          <components:ScrollingContent1 x="75" y="94" id="contentGroup" mytext="{test}" clipAndEnableScrolling="true" width="156" height="204"/>

      </s:Skin>

       


      from my main app i try to pass data to "test" in skin class:

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:d="http://ns.adobe.com/fxg/2008/dt"
                     xmlns:fc="http://ns.adobe.com/flashcatalyst/2009"
                     backgroundColor="#FFFFFF" height="600" preloaderChromeColor="#FFFFFF" width="800"
                     creationComplete="onInit()">
         
              <s:SkinnableContainer id="mySkinContainer" test="bruno"     skinClass="components.ScrollPanel1" x="179" y="65"/>

      it doesn't work , i tried another thing , but never good result.

       

      thank for your help