2 Replies Latest reply on Dec 10, 2009 5:58 PM by mliyanagamage

    Adobe Air button glitch?


      I am making an adobe air app. I use the standard buttons to change between the servral states that I have in the app. I am using some transitions to bounce the buttons and other components around. For some reason I need a double click to navigate between states. A single click works the first time but after that I need to use double clicking on the buttons. Please HELP


      Also If it turns out that the transition is what is causing this behavior then can anyone give me code for a simple transition between one state to another on button click. The transition effect should be a standard fade in and out and it should target every component I have.


      Help on both subjects is appreciated.


      Thanks ahead

        • 1. Re: Adobe Air button glitch?
          Gregory Lafrance Level 6

          If this post answers your question or helps, please mark it as such.

          Greg Lafrance

          Flex Development and Support Services

          The following code works on single clicks, but it does not wor the first time. Don't know why.



          <?xml version="1.0" encoding="utf-8"?>
          <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml">
            <mx:Button id="toBlueBtn" label="To Blue State" click="currentState='blueState'"/>
            <mx:VBox id="redVB" width="100" height="100" backgroundColor="0xFF0000"/>
              <mx:State name="blueState">
                  <mx:Button id="toRedBtn" label="To Red State" click="currentState=''"/>
                  <mx:VBox id="blueVB" width="100" height="100" backgroundColor="0x0000FF"/>
                <mx:RemoveChild target="{toBlueBtn}"/>
                <mx:RemoveChild target="{redVB}"/>
              <mx:Transition fromState="*" toState="blueState">
                  <mx:Fade targets="{[toBlueBtn, redVB]}" alphaFrom="1" alphaTo="0" duration="500"/>      
                  <mx:Fade targets="{[toRedBtn, blueVB]}" alphaFrom="0" alphaTo="1" duration="500"/>      
              <mx:Transition fromState="blueState" toState="*">
                  <mx:Fade targets="{[toRedBtn, blueVB]}" alphaFrom="1" alphaTo="0" duration="500"/>      
                  <mx:Fade targets="{[toBlueBtn, redVB]}" alphaFrom="0" alphaTo="1" duration="500"/>      
          • 2. Re: Adobe Air button glitch?
            mliyanagamage Level 1

            Yeah that transition works great, but the first time I click on the button the blue box appears without a transition, but after the first click, the clicks that follow make the transition work. Is there any fix for that?