?
Solved

controlling sound play

Posted on 1998-02-04
3
Medium Priority
?
225 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
bigelos earned 200 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Suggested Courses

649 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