Solved

controlling sound play

Posted on 1998-02-04
3
202 Views
Last Modified: 2013-12-25
I want to put a small sound file on my Web site.  I want people to be able to click on a graphic or a button and then have the sound play in that instant.  Is there a way to set this up without any messy plugins?
0
Comment
Question by:transit
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
bigelos earned 100 total points
ID: 1857081
Sure!

Just use this code:
<EMBED SRC="test.wav" volume="100" hidden="true" autostart="false">

Then, for a link you would use:
<A HREF="#" onclick="document.embeds[0].play(false);">Play</a>

For a button you would use:
<INPUT TYPE=button VALUE="PLAY" onClick="document.embeds[0].play(false);">
0
 
LVL 3

Expert Comment

by:bigelos
ID: 1857082
For the document.embeds[X].play(false), X stands for the array number of your embedded source, 0 being the first element in the array.  The embedded sources array elements are number by the order in which they load.  So, if you have more than one sound, the command to play the second would be document.embeds[1].play(false).
0
 
LVL 1

Expert Comment

by:potsy
ID: 1857083
one thing is that the <EMBED> tag still requires a plugin (Well on some browsers it does)
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now