5 Replies Latest reply on Apr 25, 2011 10:27 AM by Trimakas1

    Only one button is working inside a group

    Trimakas1

      This is weird.. not understanding why only one of these buttons is working.. its the "Tournaments" button.. and that's it.. so if I click any of the buttons the only button the reacts is the Tournament one..

       

      Help please..

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
              xmlns:s="library://ns.adobe.com/flex/spark"
              xmlns:assets="assets.*"
              actionBarVisible="false"
              overlayControls="false" tabBarVisible="false" title="Home">
         
          <fx:Declarations>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
          </fx:Declarations>
         
          <s:Group
              id="backgroundGroup"
              width="100%"
              height="100%"
              >
             
          <s:Rect id="backgroundRect" y="0" width="100%" height="100%">
              <s:fill>
                  <s:LinearGradient rotation="-90">
                      <s:GradientEntry color="#ffffff" />
                      <s:GradientEntry color="#539cef" />
                  </s:LinearGradient>
              </s:fill>
          </s:Rect>
         
              <s:Button id="newRoundButton" x="46" y="458" width="391" height="49" label="New Round"
                        enabled="true" fontFamily="Arial" fontSize="23" skinClass="skins.MyButtonSkin"/>
         
              <s:Button id="historyButton" x="44.35" y="521.35" width="391" height="49" label="History"
                        enabled="true" fontFamily="Arial" fontSize="23" skinClass="skins.MyButtonSkin"/>
             
              <s:Button id="tourneyButton" x="44.35" y="581.35" width="391" height="49" label="Tournaments"
                        enabled="true" fontFamily="Arial" fontSize="23" skinClass="skins.MyButtonSkin"/>
                 
          </s:Group>

       

          <s:layout>
              <s:VerticalLayout>
              </s:VerticalLayout>
          </s:layout>
      </s:View>

        • 1. Re: Only one button is working inside a group
          bucpatr1 Level 2

          You are going to need to provide more info. It's hard to say what the issue is without being able to see the code that adds/ responds to the listeners for the button click events.

          • 2. Re: Only one button is working inside a group
            Trimakas1 Level 1

            Well there aren't any.. right now I'm just laying out the UI.. So I decided to try and trace the click event on the buttons and they aren't getting clicked.. even the one that changes, which is weird..

             

            So I just threw a plain button up to see what would happen, and it worked fine, but then stopped working when I applied my skin.. so I think its my skin that's jacking things up somehow.. and here is that code..

             

            Any ideas here??

             

            <?xml version="1.0" encoding="utf-8"?>

             

            <!--

             

                ADOBE SYSTEMS INCORPORATED
                Copyright 2008 Adobe Systems Incorporated
                All Rights Reserved.

             

                NOTICE: Adobe permits you to use, modify, and distribute this file
                in accordance with the terms of the license agreement accompanying it.

             

            -->

             

            <!--- The default skin class for the Spark Button component.

             

                   @see spark.components.Button
                   
                  @langversion 3.0
                  @playerversion Flash 10
                  @playerversion AIR 1.5
                  @productversion Flex 4
            -->
            <s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
                         xmlns:s="library://ns.adobe.com/flex/spark"
                         xmlns:fb="http://ns.adobe.com/flashbuilder/2009"
                         xmlns:assets="assets.*"
                         minWidth="391" minHeight="49"
                         width.disabled="391" height.disabled="49" fontFamily.disabled="Arial"
                         fontSize.disabled="24"
                         width.down="391" height.down="49" fontFamily.down="Arial" fontSize.down="24"
                         width.over="391" height.over="49" fontFamily.over="Arial" fontSize.over="24"
                         width.up="391" height.up="49" fontFamily.up="Arial" fontSize.up="24">
               
                <!-- host component -->
                <fx:Metadata>
                    <![CDATA[
                    /**
                     * @copy spark.skins.spark.ApplicationSkin#hostComponent
                     */
                    [HostComponent("spark.components.Button")]
                    ]]>
                </fx:Metadata>
              
               
                <!-- states -->
                <s:states>
                    <s:State name="up" />
                    <s:State name="over" />
                    <s:State name="down" />
                    <s:State name="disabled" />
                </s:states>
               
                <assets:button_up includeIn="up"/>
                <assets:button_over includeIn="over"/>
                <assets:button_down includeIn="down"/>
                <assets:button_up includeIn="disabled"/>

             

                <!-- text layer -->
                <!--- @copy spark.components.supportClasses.ButtonBase#labelDisplay -->
                <s:Label id="labelDisplay" width="391" height="49" horizontalCenter="middle"
                         maxDisplayedLines="1" textAlign="center" verticalAlign="middle" verticalCenter="1"
                         fontFamily="Arial" fontSize="24" text="{hostComponent.label}">
                </s:Label>
               
            </s:SparkSkin>

            • 3. Re: Only one button is working inside a group
              Flex harUI Adobe Employee

              If the assets take up the visual space in the skin, then when one is

              replaced by another as you change states, that will prevent the CLICK event.

              A CLICK is only dispatched when the MOUSE_DOWN is on the same instance as

              the MOUSE_UP

              • 4. Re: Only one button is working inside a group
                Trimakas1 Level 1

                Hmm.. so does that mean I can't have two seperate fxg graphics for those two events? Up and down?

                 

                But the mobile skin that comes with Burrito has different effects for the up and down events..

                 

                I'm not understanding..

                 

                hmm?? Any help??

                 

                Todd

                • 5. Re: Only one button is working inside a group
                  Trimakas1 Level 1

                  Wow.. I FINALLY figured it out.. wow.. when I created the fxg graphic I didn't delete the background image that I had created as well.. it was just still back there and so the button was much bigger than just the graphic that I thought was the button..

                   

                  Geez..

                   

                  Todd