Animation not holding.

I implemented a menu tray that raises and lowers. It worked in the first version of the iHDSim, but in the new version the menu tray raises and then disappears. Then the lower tray button key assignment will make the tray appear again and then lower. Why is the tray not staying visible


<style id="BUTTON_TRAY" style:backgroundImage="url('MENU/BTN_TRAY.png')"
style:position="absolute" style:x="190px" style:y="720px"
style:width="900px" style:height="200px" />

<!-- effects for raising and lowering menu tray -->
<g id="RaiseTray">
<animate style:y="720px;520px" />
</g>
<g id="LowerTray">
<animate style:y="520px;720px" />
</g>

<cue begin="id('RAISE_TRY')[state:actioned()]"
end="id('LOWER_TRY')[state:actioned()]"
select="id('TRY')" dur="1s" fill="hold" use="RaiseTray" />

<cue begin="id('LOWER_TRY')[state:actioned()]"
end="id('RAISE_TRY')[state:actioned()]"
select="id('TRY')" dur="1s" fill="hold" use="LowerTray" />

<!-- hidden button for toggling menu tray -->
<div>
<button id="RAISE_TRY" accessKey="VK_MENU" />
<button id="LOWER_TRY" accessKey="VK_BACK" />
</div>




Answer this question

Animation not holding.

  • Javahar

    Right. In general dur is for animation duration and end is for termination. I think that you should be able to use both, and this is just a bug in iHDSim that freaks out when you have both, but I don't have the spec handy right now.

    The code you have works because there is no confusion -- the par has a begin and end, and the cue has an explicity dur that will hold the final value until the par ends.



  • Ron L

    Nice find Bryan. Thanks again both of you.


  • hrd2hndl67

    I made the alteration below. That works. It seems like dur and end should not conflict - one is to indicate the duration of the animation and the other is to indicate the end of the animation (releasing the hold). Right

    So why does this solution (below) work



    <par begin="id('RAISE_TRY')[state:actioned()]"
    end="id('LOWER_TRY')[state:actioned()]" >
    <cue select="id('TRY')" dur="1s" fill="hold" use="RaiseTray" />
    </par>

    <par begin="id('LOWER_TRY')[state:actioned()]"
    end="id('RAISE_TRY')[state:actioned()]" >

    <cue select="id('TRY')" dur="1s" fill="hold" use="LowerTray" />
    </par>


  • glavian

    Actually, the spec states in chapter 7 somewhere (Don't have my spec handy right now) that a <cue> with both dur and end will only last until one of them finishes.

    <cue dur=1s end="id('button')[state:actioned()]">

    will end at the earliest occurrence of 1s or the button being actioned. If you action the button before 1 second has passed, it will end then, but if you don't action the button, it will end in 1 second.

    The old simulator had bad behaviour in this case (although I preferred it's behaviour :-))


  • dlevers

    Probably because you have both a dur and an end; I think this is a bug (can't check right now...)

    Put the begin / end inside a <par>, and have the dur inside the child <cue>:

    <par begin=raise end=lower>
    <cue dur=1s fill=hold use=raise />
    </par>



  • Animation not holding.