• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sound multiplies with clicks?

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I have a webpage where I need a sound to be played one the user clicks the image,
this work correctly the first time but one the clip is finished, and I push the button the second time.
The sound plays twice at the same time. By setting the hidden tag to true you can see that an extra
player pops up and both players start playing at once?

Here is a smaller version of the code:





Any ideas on how I can remove the player once the clip is finished? Or to prevent multiple playing's?

Thanks
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You would be better using something like SoundManager 2.

Eric
 
Lila Fowler
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks but the above requires a download and uses flash... I am only supposed to use js and html.
Does anyone have any ideas how to fix this in html? If it provides the functionality to play a sound
then there should be a way to close the player?

Thanks
 
Lila Fowler
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I figured out what the problem was, here is a the working version.

 
reply
    Bookmark Topic Watch Topic
  • New Topic