I set my top button to focused()=true on startup - the intention is to have one button start with focus. However in the iHDSim, I cannot nav away from this button. If I do not set focused(), then no buttons have focus, however I can click on one and then get proper navigation.

Starting Focus Stuck
Emissary
Andy Brooker
MARKUP
<timing clock="page">
<defs>
<!-- Effects for opening and closing main menu. -->
<g id="OpenMenu">
<set style:display="auto" />
<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>
<!-- Navigable menu buttons. -->
<cue use="ButtonFocus" begin="id('AUDIO01')[state:focused()=true()]" end="defaultNode()[state:focused()=false()]" />
<cue use="ButtonFocus" begin="id('AUDIO02')[state:focused()=true()]" end="defaultNode()[state:focused()=false()]" />
<cue use="ButtonFocus" begin="id('AUDIO03')[state:focused()=true()]" end="defaultNode()[state:focused()=false()]" />
<cue use="ButtonFocus" begin="id('RANDOM')[state:focused()=true()]" end="defaultNode()[state:focused()=false()]" />
<cue use="ButtonFocus" begin="id('SHUFFLE')[state:focused()=true()]" end="defaultNode()[state:focused()=false()]" />
<cue use="ButtonFocus" begin="id('SEQUENTIAL')[state:focused()=true()]" end="defaultNode()[state:focused()=false()]" />
<!-- Settings selection. -->
<cue use="BoxChecked" begin="class('BTN_SETTING')[state:actioned()=true()]" dur="100ms" />
<!-- Track selection. -->
<par begin="class('BTN_PLAY')[state:actioned()=true()]" dur="2s" >
<cue use="PlayAudio" begin="1s" dur="1s" />
</par>
<!-- Settings selection. -->
<cue use="BoxChecked" begin="id('RANDOM')[state:actioned()=true()]" dur="1s" />
<cue use="BoxChecked" begin="id('SHUFFLE')[state:actioned()=true()]" dur="1s" />
<cue use="BoxChecked" begin="id('SEQUENTIAL')[state:actioned()=true()]" dur="1s" />
<!-- Track selection. -->
<par begin="class('BTN_PLAY')[state:actioned()=true()]" dur="3s" >
<cue use="PlayAudio" begin="2s" dur="2s" />
</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')[style:x()='-450px'] or (id('BTN_MENU')[state:actioned()] 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>
</head>
<body>
<!-- Static Background -->
<div id="BG" style="BACKGROUND" >
</div>
<!-- Popup Menu -->
<div id="MENU" style="MAIN_MENU" >
<div id="PLY_BTNS" style="PLAY_BUTTON_CONTAINER">
<button id="AUDIO01" style="BTN_AUDIO_01" class="BTN_PLAY BTN_FOCUS" />
<button id="AUDIO02" style="BTN_AUDIO_02" class="BTN_PLAY BTN_FOCUS" />
<button id="AUDIO03" style="BTN_AUDIO_03" class="BTN_PLAY BTN_FOCUS" />
</div>
<div id="PLY_SETTINGS" style="PLAY_SETTING_CONTAINER">
<div id="CHKBOXES" style="CHECKBOX_CONTAINER">
<div id="BOX1" style="CHECKBOX_01" />
<div id="BOX2" style="CHECKBOX_02" />
<div id="BOX3" style="CHECKBOX_03" />
</div>
<div id="SETTINGS_BTNS" style="SETTING_BUTTON_CONTAINER">
<button id="RANDOM" style="BTN_RANDOM" class="BTN_FOCUS" />
<button id="SHUFFLE" style="BTN_SHUFFLE" class="BTN_FOCUS" />
<button id="SEQUENTIAL" style="BTN_SEQUENTIAL" class="BTN_FOCUS" />
</div>
</div>
</div>
<!-- Hidden button for toggling Main Menu. -->
<div>
<button id="BTN_MENU" accessKey="VK_MENU" />
<div id="MENU_STATE" />
</div>
</body>
</root><par>
<!-- Navigable menu buttons. -->
<cue use="ButtonFocus" begin="id('AUDIO01')[state:focused()=true()]" end="defaultNode()[state:focused()=false()]" />
<cue use="ButtonFocus" begin="id('AUDIO02')[state:focused()=true()]" end="defaultNode()[state:focused()=false()]" />
<cue use="ButtonFocus" begin="id('AUDIO03')[state:focused()=true()]" end="defaultNode()[state:focused()=false()]" />
<cue use="ButtonFocus" begin="id('RANDOM')[state:focused()=true()]" end="defaultNode()[state:focused()=false()]" />
<cue use="ButtonFocus" begin="id('SHUFFLE')[state:focused()=true()]" end="defaultNode()[state:focused()=false()]" />
<cue use="ButtonFocus" begin="id('SEQUENTIAL')[state:focused()=true()]" end="defaultNode()[state:focused()=false()]" />
<cue use="BoxChecked" begin="id('RANDOM')[state:actioned()=true()]" dur="1s" />
<cue use="BoxChecked" begin="id('SHUFFLE')[state:actioned()=true()]" dur="1s" />
<cue use="BoxChecked" begin="id('SEQUENTIAL')[state:actioned()=true()]" dur="1s" />
<par begin="id('AUDIO01')[state:actioned()=true()]" dur="3s" >
<cue select="id('AUDIO01')" use="PlayAudio" begin="2s" dur="2s" />
</par>
<par begin="id('AUDIO02')[state:actioned()=true()]" dur="3s" >
<cue select="id('AUDIO02')" use="PlayAudio" begin="2s" dur="2s" />
</par>
<par begin="id('AUDIO03')[state:actioned()=true()]" dur="3s" >
<cue select="id('AUDIO03')" use="PlayAudio" begin="2s" dur="2s" />
</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="Show" />
<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')[style:x()='-450px'] or (id('BTN_MENU')[state:actioned()] 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" />
<cue select="id('MENU')" dur="1s" fill="hold" use="Show" />
</par>
</par>
</timing>
</head>
<body>
<!-- Static Background -->
<div id="BG" style="BACKGROUND" >
</div>
<!-- Popup Menu -->
<div id="MENU" style="MAIN_MENU" >
<div id="PLY_BTNS" style="PLAY_BUTTON_CONTAINER">
<button id="AUDIO01" style="BTN_AUDIO_01" class="BTN_PLAY BTN_FOCUS" state:focused="true" />
<button id="AUDIO02" style="BTN_AUDIO_02" class="BTN_PLAY BTN_FOCUS" />
<button id="AUDIO03" style="BTN_AUDIO_03" class="BTN_PLAY BTN_FOCUS" />
</div>
<div id="PLY_SETTINGS" style="PLAY_SETTING_CONTAINER">
<div id="CHKBOXES" style="CHECKBOX_CONTAINER">
<div id="BOX1" style="CHECKBOX_01" />
<div id="BOX2" style="CHECKBOX_02" />
<div id="BOX3" style="CHECKBOX_03" />
</div>
<div id="SETTINGS_BTNS" style="SETTING_BUTTON_CONTAINER">
<button id="RANDOM" style="BTN_RANDOM" class="BTN_FOCUS" />
<button id="SHUFFLE" style="BTN_SHUFFLE" class="BTN_FOCUS" />
<button id="SEQUENTIAL" style="BTN_SEQUENTIAL" class="BTN_FOCUS" />
</div>
</div>
</div>
<!-- Hidden button for toggling Main Menu. -->
<div>
<button id="BTN_MENU" accessKey="VK_MENU" />
<div id="MENU_STATE" />
</div>
</body>
TheAmigo
Out of frustration I rewrote the markup and now state:focused="true" is working. Not sure what was wrong but neither the validator or VS intellisense caught it.
khen
Should be
<button id="AUDIO01" style="BTN_AUDIO_01" class="BTN_PLAY BTN_FOCUS" focused="true" />
or
<button id="AUDIO01" style="BTN_AUDIO_01" class="BTN_PLAY BTN_FOCUS" focus="true" />
Try both...
I will look on Wednesday when I get back in the office...Hit me up when you are back also you can check my project out.
Oliver 123
If I don't set a starting focus things navigate fine, once I use the mouse to get focus somewhere.
Marius F
Master Hugo
Just set state:focused="true" on that button in markup.
If you must do it through script, then might I suggest you revist my blog post :-)
http://blogs.msdn.com/ptorr/archive/2006/09/08/746678.aspx