Sliding menu animation error

The sliding menu I did in Markup, with Peter's help, is working pretty well.

It slides open on start, and closes automatically if a track is selected. However one thing I cannot fix is that after the first time you open the menu while a video is playing, it will no longer animate, it just appears.

For example:

1) Start project, after 1s menu slides open.
2) Select track, menu automatically slides shut.
3) Open menu using menu button (CTRL+M) and menu slides open.
4) Select another track and menu slides shut.
5) Open menu using menu button (CTRL+M) and menu DOES NOT slide open, but rather just appears. This will happen everytime you open the menu after step #4 in this example.

Any advice on how to debug

<timing clock="page">
<defs>
<!-- Effects for opening and closing main menu. -->
<g id="OpenMenu">
<animate style:x="-450px;0px" />
</g>
<g id="CloseMenu">
<animate style:x="0px;-450px" />
</g>

<!-- Effects for check boxes. -->
<g id="BoxChecked">
<event name="SettingBoxChecked" />
</g>

<!-- Effects for buttons. -->
<g id="ButtonFocus">
<set style:backgroundFrame="1" />
</g>
<g id="PlayAudio">
<event name="PlayAudioTrack" />
</g>

<!-- Menu state management. -->
<set id="StateMenuCanOpen" style:x="0px"/>
<set id="StateMenuCanClose" style:x="1px"/>
</defs>

<par>

<!-- Open the menu on start. -->
<par begin="1s" >
<cue select="id('MENU_STATE')" dur="1s" fill="hold" use="StateMenuCanClose" />
<cue select="id('MENU')" dur="1s" fill="hold" use="OpenMenu" />
</par>

<!-- Focus a navigable menu button. -->
<cue begin="class('BTN_FOCUS')[state:focused() and count(class('BTN_FOCUS')[style:backgroundFrame() = 1]) = 0]"
end="defaultNode()[state:focused()=false()]" use="ButtonFocus" />

<!-- Set slideshow type. -->
<cue use="BoxChecked" begin="class('BTN_SETTING')[state:actioned()=true()]" dur="100ms" />

<!-- Play a track. -->
<par begin="class('BTN_PLAY')[state:actioned()=true()]" dur="2s" >
<cue use="PlayAudio" begin="1s" dur="1s" />
</par>

<!-- Open the menu if Menu button is pressed. -->
<par begin="(id('BTN_MENU')[state:actioned()=true()] and id('MENU_STATE')[style:x()='0px'])"
end="(id('BTN_MENU')[state:actioned()=true()] and id('MENU_STATE')[style:x()='1px'])">

<cue select="id('MENU_STATE')" dur="1s" fill="hold" use="StateMenuCanClose" />
<cue select="id('MENU')" dur="1s" fill="hold" use="OpenMenu" />
</par>

<!-- Close the menu if Menu button is pressed or if track is selected for play. -->
<par begin="((id('BTN_MENU')[state:actioned()=true()] or class('BTN_PLAY')[state:actioned()=true()])
and id('MENU_STATE')[style:x()='1px'])"

end="(id('BTN_MENU')[state:actioned()=true()] and id('MENU_STATE')[style:x()='0px'])">

<cue select="id('MENU_STATE')" dur="1s" fill="hold" use="StateMenuCanOpen" />
<cue select="id('MENU')" dur="1s" fill="hold" use="CloseMenu" />
</par>
</par>

</timing>




Answer this question

Sliding menu animation error

  • Jough

    I rebuilt all the begin and end conditions with your suggestions Peter. I made a couple other tweaks and it works now.

    Thanks!




  • tolily

    On the topic of sliding items...All the sliding code I have tried on the Sonic simulator crashes with a runtime error...but it plays fine on iHD Sim and it works fine on the HD-XA1 from disc...Anyone get slides to show in the Sonic Simulator


  • edwinzzz

    For a start, I'd put an end on your first par just so it goes away (eg, when the menu button is clicked).

    But the problem is that your end for the first par doesn't match the begin for your second one -- you added the BTN_PLAY condition. So the first par remains active if you click the BTN_PLAY button.



  • Simon Dahlbacka

    Instead of 50 DVD-R you could use 1 (4x) DVD+RW.
  • Lee Brimelow

    Oh Sammaz, we have not had much luck at all with the Sonic emulator. We're getting the Toshiba one soon so hopefully we'll get better mileage on that.


  • paul1857

    I've had animated menus working in Sonic's emulator for quite some time now. One major difference though, my animations are driven from script.
  • JGreever

    Since DVD-r are pretty cheap I went through a 50 pack this week just in testing...but you HAVE to see how it looks on the XA-1...I usualy test to make sure there are no outstanding errors then do a quick burn before proceding any further...every "thing" I do gets tested on XA-1 before continuing development.

    I dont think we can justify the cost atm...50 pack dvd-r for 4.99$ is ALOT cheaper than the quote I got on the Tosh Emu....and also it takes 5 mins to fire up the Tosh Emu properly.


  • Sliding menu animation error