How to loop the button animation

How to loop the button animation as long as it is focused My xml works only for when the menu gets focused, but not continuous animating.

</defs>
<animate id="set_focus" style:backgroundFrame="1;2;3;4;5"/>
</defs>


<cue begin="id('AddiContent')[state:focused()=true()]" end="id('AddiContent')[state:focused()=false()]" dur="1s" use="set_focus" fill="hold" />


<button id="WinterTour" state:focused="true" style:position="absolute" style:x="1124px" style:y="436px" style:width="556px" style:height="42px"
style:backgroundImage ="url('B1_Normal_N001.png')
url('B1_Select_S001.png')
url('B1_Select_S002.png')
url('B1_Select_S003.png')
url('B1_Select_S004.png')
url('B1_Select_S005.png')
url('B1_Select_A001.png')"/>

Thx



Answer this question

How to loop the button animation

  • AndrewStone

    You need to base your start on something that changes in the animation. This is specified in Chapter 7.7.2.6: "Time Resolution". Essentially, a timing block can only restart if it's begin has transitioned back to false at some point.

    Also, in 7.7.2.2, you'll note that if you specify both end and dur, then the first one to end ends the timing interval.

    So you'd have to do something like this:

    <par begin="id('AddiContent')[state:focused()=true()]" end="id('AddiContent')[state:focused()=false()]">

    <cue begin="id(AddiContent')[style:backgroundFrame()!=1]" dur="1s" use="set_focus"/>

    </par>

    What that will do is pull the begin to false as soon as the animation starts, and then the <cue> would be allowed to restart when the 1s finishes. The begin would once again be true, and the animation would loop.


  • rfuller

    Sorry, my mistake. I had a typo on the condition. It works fine now. Thank you very much!
  • Desmond Green

    Thank you. The new code totally make scense. But it does not work! The button image stays in Normal state. Is there any other codition to trigger the animation
  • How to loop the button animation