09-22-2012 02:35 PM
I have a button when clicked (onClicked) invokes the play() function for an animation. This worked perfectly except only once. When I click on the button a second time or more nothing happens. Button visibly appears to receive focus ok (although I guess with a touch screen you don't really need to set focus).
I cannot find any documentation that says OnClicked only works once or once an animation has stopped it can not be played again.
What am I missing - either in my code or in my understanding?
09-22-2012 03:06 PM
I'm thinking that once a transition has occurred you cannot redo that transition unil you return to the original state. However, I have no idea how to do that.
In my case, I just happen to be back where I started from but cascades doesn't know that!
I added a reverse transition to get me back to my orignal state (which is where I was anyways).
Now, as far as I can tell it does both transitions forward and back. Ignores the first click. Then, does the transitions back and forward. It happens so fast I am not really sure that it does them in reverse. But its so funny I can't stop laughing. I will change some properties to slow down the transition.
Meanwhile, how do I restore the original state. Reload the image? Save some properties and restore them?
09-22-2012 06:50 PM
I found a removeAnimation or removeAllAnimations that seems to work. I added a second button to do the reset and as soon as I did that the first button worked as expected(?) without doing the remove animations.