Solved

controlling sound play

Posted on 1998-02-04
3
217 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 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

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…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The viewer will learn how to count occurrences of each item in an array.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

732 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