Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Plano, Texas
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Play Sound Then Continue....

    I searched for this topic, but did not find s suitable solution.

    I have a game page button that calls EvalSound('Roulette_Spin') onclick.

    The sound wav last 8.20 seconds. The script does not wait for the sound wav to complete before running most if not all of NowDoThis().

    Could someone assist me with a pause or wait script that will truly wait the entire 8.20 seconds before executing NowDoThis().

    Thank you in advance for any suggesions, solutions or ideas. If a previous post covers, direction to it would also be appreciated.
    =============================================
    Code:
    <script>
    function EvalSound(soundobj) {
     var thissound= eval("document."+soundobj);
     thissound.Play();
    NowDoThis()
    }
    </script>
    
    <embed src="../Sounds/Roulette_Spin.wav" hidden="true" autostart="false" true name="Roulette_Spin" enablejavascript="true">
    
    <scipt>
    function NowDoThis(){
    	if (some logic sattements)
    	document.forms.field.value=(some values etc.)
    }
    =============================================

  • #2
    Regular Coder
    Join Date
    Nov 2003
    Location
    Vancouver Island Canada
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This may work although if dl times vary, could be a problem.
    Code:
    <script>
    function EvalSound(soundobj) {
     var thissound= eval("document."+soundobj);
     thissound.Play();
    setTimeout(NowDoThis(), 8260);
    }
    </script>
    
    <embed src="../Sounds/Roulette_Spin.wav" hidden="true" autostart="false" true name="Roulette_Spin" enablejavascript="true">
    
    <scipt>
    function NowDoThis(){
    	if (some logic sattements)
    	document.forms.field.value=(some values etc.)

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Plano, Texas
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts
    WoW! Thx for quick response. That produces invalid arument error messsage

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Plano, Texas
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Perfecto!!! Just had to enclose 'NowDoThis()' with apostrophes.

    Thank You!!!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •