3 Replies Latest reply on Jun 10, 2009 11:44 AM by garigantua

    Style selector not working...

    garigantua

      Why does the mx|ToggleButtonBar style selector not work in the following code?

       

      <?xml version="1.0"?>
      <!-- Simple example to demonstrate the Halo TabNavigator layout container. -->
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:s="library://ns.adobe.com/flex/spark"
                        xmlns:mx="library://ns.adobe.com/flex/halo">
           
           
           <fx:Style>
                
                /* Not working */
                 mx|ToggleButtonBar{
                     buttonStyleName:"mytoggleButtonBarButtonStyle"; 
                     firstButtonStyleName:"mytoggleButtonBarButtonStyle"
                }
                
                /* okay */
                 #tbb{
                     buttonStyleName:"mytoggleButtonBarButtonStyle"; 
                     firstButtonStyleName:"mytoggleButtonBarButtonStyle"
                }
                .mytoggleButtonBarButtonStyle{
                     skin: ClassReference("skins.custButtonSkin");
                } 
           </fx:Style>    
           <s:VGroup>
                <mx:ToggleButtonBar id="tbb">
                <mx:dataProvider>
                     <fx:Array>
                          <fx:String>Flex</fx:String>
                          <fx:String>Flash</fx:String>
                          <fx:String>ColdFusion</fx:String>
                     </fx:Array>
                </mx:dataProvider>
           </mx:ToggleButtonBar>
           
           <mx:ToggleButtonBar id="tbb2">
                <mx:dataProvider>
                     <fx:Array>
                          <fx:String>Flex</fx:String>
                          <fx:String>Flash</fx:String>
                          <fx:String>ColdFusion</fx:String>
                     </fx:Array>
                </mx:dataProvider>
           </mx:ToggleButtonBar>
           </s:VGroup>
           
      </s:Application>
      

        • 1. Re: Style selector not working...
          garigantua Level 1

          it gives a compiler warning of this:

           

          Multiple markers at this line: -The CSS type selector 'ToggleButtonBar' was not processed, because the type was not used in the application. -Type 'ToggleButtonBar' in CSS selector 'ToggleButtonBar' must be qualified with a namespace.

          • 2. Re: Style selector not working...
            garigantua Level 1

            sorry, it works...

             

            I forgot my namespaces

            • 3. Re: Style selector not working...
              garigantua Level 1

              <?xml version="1.0"?>
              <!-- Simple example to demonstrate the Halo TabNavigator layout container. -->
              <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                                xmlns:s="library://ns.adobe.com/flex/spark"
                                xmlns:mx="library://ns.adobe.com/flex/halo">
                   
                   
                   <fx:Style>
                   @namespace mx "library://ns.adobe.com/flex/halo";
                        @namespace s "library://ns.adobe.com/flex/spark";
                        
                        /* Not working */
                         mx|ToggleButtonBar{
                             buttonStyleName:"mytoggleButtonBarButtonStyle"; 
                             firstButtonStyleName:"mytoggleButtonBarButtonStyle"
                        }
                        
                        /* okay */
                         #tbb{
                             buttonStyleName:"mytoggleButtonBarButtonStyle"; 
                             firstButtonStyleName:"mytoggleButtonBarButtonStyle"
                        }
                        .mytoggleButtonBarButtonStyle{
                             skin: ClassReference("skins.custButtonSkin");
                        } 
                   </fx:Style>    
                   <s:VGroup>
                        <mx:ToggleButtonBar id="tbb">
                        <mx:dataProvider>
                             <fx:Array>
                                  <fx:String>Flex</fx:String>
                                  <fx:String>Flash</fx:String>
                                  <fx:String>ColdFusion</fx:String>
                             </fx:Array>
                        </mx:dataProvider>
                   </mx:ToggleButtonBar>
                   
                   <mx:ToggleButtonBar id="tbb2">
                        <mx:dataProvider>
                             <fx:Array>
                                  <fx:String>Flex</fx:String>
                                  <fx:String>Flash</fx:String>
                                  <fx:String>ColdFusion</fx:String>
                             </fx:Array>
                        </mx:dataProvider>
                   </mx:ToggleButtonBar>
                   </s:VGroup>
                   
              </s:Application>