Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 6th, 2008, 04:57 PM
Registered User
Join Date: Sep 2008
Location: Indian Rocks Beach, FL, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default playing SWF sound onmouseover

I've been trying to get a song to play when the mouse rolls over an image on my webpage. I've had only partial success in that I get the music to play when the page comes up. The mouse does nothing. Does anybody know how to do this?
I've tried with and without javascript and cannot get it to work. If I ever do get it to work, I would like the music to stop when the mouse leaves the image.
Any help would be appreciated,

Reply With Quote
  #2 (permalink)  
Old October 6th, 2008, 06:12 PM
jminatel's Avatar
Wrox Staff
Points: 18,940, Level: 59
Points: 18,940, Level: 59 Points: 18,940, Level: 59 Points: 18,940, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: May 2003
Location: Indianapolis, IN, USA.
Posts: 1,945
Thanks: 73
Thanked 139 Times in 101 Posts

Rich: Do you want to share the JavaScript you've tried so far?

Jim Minatel
Acquisitions Director
Wiley Technology Publishing
WROX Press
Blog: http://wroxblog.typepad.com/
Wrox online library: http://wrox.books24x7.com
Reply With Quote
  #3 (permalink)  
Old October 7th, 2008, 02:09 PM
Registered User
Join Date: Sep 2008
Location: Indian Rocks Beach, FL, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

Hi Jim,
I've tried tons of scripts and I believe this is where I left off. I've been around and around so I've probably done this one before and do not remember.
================================================== ======================
  <meta http-equiv="content-type" content="text/html;charset=UTF-8"/>

<script type="text/javascript">
function mouseOver()
document.b1.src ="cbells.swf";
function mouseOut()
document.b1.src ="juke.jpg";

<a href="http://www.w3schools.com" target="_blank"
<img border="0" alt="cbells.swf"
src="juke.jpg" name="b1" /></a>


Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
playing sound files (java 2 jdk1.3 edition) naresh Java Basics 1 April 11th, 2009 01:04 AM
How to playing music in C#? Viet Hoang C# 2005 4 June 13th, 2006 03:51 AM
playing with textbox ninjai ASP.NET 1.0 and 1.1 Basics 1 September 24th, 2005 12:38 PM
Playing music in C# Fightfish C# 0 June 26th, 2005 08:09 AM
Playing a WAV without interupting sub shadowpug VB.NET 2002/2003 Basics 5 July 5th, 2003 10:24 AM

All times are GMT -4. The time now is 02:11 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.