0 Replies Latest reply on Sep 12, 2007 1:19 PM by gtcroz

    Binding breaks with using transitions

      I'm rather green to the whole Flex world, so please be gentle. It's a distinct possibility that I'm overlooking something very simple.

      I have a client that uses a graphical icon to represent its connectivity to my Java server over an XMLSocket. When the client reconnects the expected behavior is that this icon will fade away, and then fade back in.

      Here is the image tag:

      <mx:Image source="@Embed('assets/loggedin.png')" visible="{model.loggedIn}" toolTip="Logged In" showEffect="{fadeIn}" hideEffect="{fadeOut}"/>

      Here are the transitions:

      <mx:Fade id="fadeOut" duration="600" alphaFrom="1.0" alphaTo="0.0"/>
      <mx:Fade id="fadeIn" duration="600" alphaFrom="0.0" alphaTo="1.0"/>

      Under most circumstances this image behaves as expected: it fades to visibility when I log in, and fades out when I disconnect. The problem I run into is when I reconnect (which sets the bound value to false and then back before the transition has completed, the image will remain invisible.

      My instinct tells me that it's getting set to false which begins the transition and then being set back to true before the transition has expired. Rather than queuing up the next transition it seems to just skip it.

      Is there a way to either interrupt the transition if the binding changes during the transition, or even better, to queue it up so that when it's done the transition it will then begin the next transition if the state of the image doesn't accurately reflect the current bound value?