3 Replies Latest reply: Apr 6, 2012 11:01 AM by Chipleh RSS

    Spark - ButtonBarButton - Specify unique skin for all middle buttons...

    Chipleh Community Member

      Hi Flex Masters,

       

      I am trying to figure out a way to apply a unique skinClass to all middle buttons within the ButtonBarButton component. I have a unique skin specified for the first, middle and last button, but have no idea idea how apply a uniqueSkin class for each of the middle buttons. I have a first button, 4 middle buttons and a last button.

       

      <!-- 1 -->
              <fx:Component id="firstButton">                    
                  <buttons:HatchedButton allowDeselection="false"                
                      height="115%"
                      width="115"    
                      fontFamily="MyriadPro"
                      fontWeight="bold"
                      skinClass="HatchedButtonSkin"
                  >                                        
                  </buttons:HatchedButton>
              </fx:Component>
             
      
              <!-- 2 through 5 -->
              <fx:Component id="middleButton" >            
                  <buttons:HatchedButton allowDeselection="false"
                      height="115%"
                      width="115"                
                      fontFamily="MyriadPro"
                      fontWeight="bold"        
                      skinClass="HatchedButtonSkinMiddle"
                  />            
              </fx:Component>
      
               <!-- 6 -->
              <fx:Component id="lastButton" >
                  <buttons:HatchedButton allowDeselection="false"
                      height="115%"
                      width="115"                
                      fontFamily="MyriadPro"
                      fontWeight="bold"
                      skinClass="HatchedButtonSkinLast" />                                            
              </fx:Component>       
      

       

      For <!-- 2 through 5 --> is there a way to specify an array of skinClass(es) is order to apply unique skin for button 2 through 5, via a dataProvider or other technique?  Can anyone provide an example or link on how to accomplish this task that has me stuck?

       

      Thanks so much for any help,

      ~Chipleh

        • 1. Re: Spark - ButtonBarButton - Specify unique skin for all middle buttons...
          Chipleh Community Member

          Seeing how my first example is a dud, anyone know how I could apply the following arrayCollection to my skinClass?

          <s:ArrayCollection id="collectionWorkspace">

                          <fx:Class>MiddleButtonFirst</fx:Class>

                          <fx:Class>MiddleButtonSecond</fx:Class>

                          <fx:Class>MiddleButtonThird</fx:Class>

                          <fx:Class>MiddleButtonFourth</fx:Class>

          </s:ArrayCollection>

           

          Then somehow apply the arrayCollection, like so:

           

               <!-- 2 through 5 -->
                  <fx:Component id="middleButton" >           
                      <buttons:HatchedButton allowDeselection="false"
                          height="115%"
                          width="115"               
                          fontFamily="MyriadPro"
                          fontWeight="bold"       
                         
          skinClass="{Object(data).constructor}"
                      />           
                  </fx:Component>

           

          I can't find the method to make this work, so any help would be much oblidged.

           

          ~Chipleh

          • 2. Re: Spark - ButtonBarButton - Specify unique skin for all middle buttons...
            Flex harUI Adobe Employee

            You might be able to create a single skin that instantiates a class from the arraycollection.

            • 3. Re: Spark - ButtonBarButton - Specify unique skin for all middle buttons...
              Chipleh Community Member

              Hi Flex harUI,

               

              Thanks for the reply! Being newish to working with Flex, what would that look like? I know my AS3, my MXML, not so much... yet.