10 Replies Latest reply on Mar 30, 2011 4:29 AM by CleanCoder

    how to get elements from skin class?

    latimi

      Hi all,

       

      I am completely stacked with getting elements being defined directly in a skin class. To illustrate:

       

      I have a component of the SkinnableComponent type having in its turn, specific skinClass:

       

      MainApplication.mxml:

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" ...  >

      <header:ApplicationHeader width="100%" height="30"/>

      </s:Application>

       

      ApplicationHeader:

      <s:SkinnableComponent ...  skinClass="components.header.ApplicationHeaderSkin">

      </s:SkinnableComponent>

       

      And the ApplicationHeaderSkin defines some elements inside it:

      <s:Skin ...>

      ...

           <s:HGroup >

                <s:Label id="label1" color="white" />

                <s:Button id="button" width="36" height="100%" />

           </s:HGroup>

      </s:Skin>

       

       

      The original task is to instrument the ApplicationHeader skinnableComponent to make it accessible for automation tools. For this purpose i need to create a delegate class with getAutomationChildren and getAutomationChildAt method. The delegate is constructed with the SkinnableCompoment obj (the ApplicationHeader in my case).

       

      So the question is: how to get children (or elements in context of flex 4) defined in a skin class by having only host component reference of this skin?

       

      I will appreciate any hint, any reference to a similar problem description.

      Great thanks in advance

      Tim