Current location: Hot Scripts Forums » General Web Coding » JavaScript » Play a sound on button click


Play a sound on button click

Reply
  #1 (permalink)  
Old 08-31-06, 05:54 AM
magicadmin magicadmin is offline
Newbie Coder
 
Join Date: Jun 2006
Location: UK
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Play a sound on button click

Hi all,

How can i play a sound on button click..

The way I'm doing it works fine.. but i need to replace the <embed> tag coz of w3c.. i need my coding to pass.

Code:
//Fire the sound.
EvalSound('paint');

// Play sound events..
function EvalSound(soundobj) {
	var thissound=document.getElementById(soundobj);
	thissound.Play();
}


<embed src='./sounds/paint.wav' volume='100' autostart='false' width='0' height='0' id='paint' enablejavascript='true'></embed>
So how can i do it instead ???


Thanks
__________________
Midnight Fun
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
on button click, open an email client ! n3wb!e JavaScript 4 07-14-06 04:37 AM
C# Button Click Question Barnz1986 Windows .NET Programming 2 04-28-06 12:31 PM
Form not updateding when I click radio button. Spreegem JavaScript 9 03-25-06 06:50 PM
Click Widget, Play Sound keith28 JavaScript 0 02-09-06 04:00 AM
please help ,why cannot play the sound hptone JavaScript 0 10-31-04 08:05 AM


All times are GMT -5. The time now is 11:15 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.