Moving too fast, problem with sound

<defs>

<set id="ButtonFocused"

style:backgroundFrame="1"

style:opacity="1.0"

/>

<set id="ButtonHover"

state:focused="true"

/>

<g id="gAnswerButton1">

<set style:backgroundFrame="2"/>

<event name="ButtonAnswerEvent" >

<param name="numB" value="1"/>

</event>

</g>

</defs>


Answer this question

Moving too fast, problem with sound

  • Ri-Karou

    Only one sound effect can play at a time, so if you're sound is half a second long and the user can move to multiple buttons in that half second duration, then you're only going to hear one sound.

    You could try a shorter duration (is your sound really .5 seconds ) or you could try using "end" instead of "dur" like

    end="id('answerButton1')[state:focused()!=true()]"



  • Tom Frey

    The trouble is that the sound needs to go to display="none" before it will play again. With your current cues, the menu sound will always be "auto" (ie, playing) if you switch focus fast enough. Once it has played once, it will never play again until you stop focusing for 0.5s or more. Also, as DrumAllDay suggests, you should stop when focus moves off the button rather than after a specific duration.

    So given that, you want your cue to be something like this so that it goes to "none" before picking back up to "auto":

    <cue select="id('MenuSound')"
    begin="(id('answerButton1')[state:focused()=true()] and id('MenuSound')[style:display()='none'])"
    end="id('answerButton1')[state:focused()!=true()]" >

    Also, to make your code display semi-nicely in the forums, use a <Shift> + <Enter> at the end of every line instead of just an <Enter>. Or go to HTML view and insert <BR> tags instead of </P> tags :-)



  • tcarff

    Do you check if another effect is playing
    if (Player.audio.effect.playing){}


  • Moving too fast, problem with sound