Click to See Complete Forum and Search --> : Please help - playing sound via three methods (onMouseover, buttons, links)


CalifNina
06-03-2003, 10:25 AM
I give up from my post last evening:

--> "onMouseover & onMouseout not working"
--> http://forums.webdeveloper.com/showthread.php?s=&threadid=10507

in that I located some code from another thread:

--> http://javascriptkit.com/script/script2/soundlink.shtml

and tried to use it to play sound using three methods - (onMouseover, buttons, and links). Messed with it for quite awhile but could not get to work. The code found combines everything together, maybe I should break it apart into separate sections and not be so complicated? Am new to Javascript this is why I am asking. Believe me, I did search around and put my hours in trying to make it work, but am still at the same spot, no success.

Thus I give up and will reask for assistance in this manner ...
(1) Looking for code to play sounds via 'onMouseover'

(2) Looking for another set of code to play sounds via 'buttons'

(3) Looking for other code to play sounds via 'links assigned a specific sound'Maybe if I see code per each method and work on it one bite at a time - I'll do better. Then later the big combined stuff I'll be able to work through.

Please, any code offers?? - complete examples for both the HEAD and BODY sections as I need to see the whole thing, not just portions. At this point (beginner) if you make assumptions that I have certain parts, I will miss it. I do understand it has to be defined in the HEAD section and then sounds need to be preloaded, then in BODY section the function is called, etc. You can see from my previous post that I did try and did offer the code I had.

NOTE: my sound files are in same directory but in a folder called "sounds2"

(i.e.,)
var aySound = new Array();
aySound[0] = "sounds2/soundA.wav";
aySound[1] = "sounds2/soundB.wav";
aySound[2] = "sounds2/soundC.wav";
aySound[3] = "sounds2/soundD.wav";

Thank you, very frustrated. ~ Nina

gil davis
06-03-2003, 11:12 AM
Sorry that you are frustrated.

These forums are supported by volunteers with varying degrees of expertise. Since you are not getting a response, apparently no one has the specific expertise. It may also be that those who do have the expertise are not willing to share for free. You cannot extract a reply by sheer will. It doesn't work that way. If there is interest, there will be a response.

One of the difficulties with music on a web page lies in the fact that there is no standard way to do it. Browsers do not usually have a "native" way to make sound - they use a "helper application" (RealAudio, WinAMP, QuickTime, MediaPlayer, among others). You have to know which one will work with a given client, or at least tell him which one you have coded your page for. It can quickly become a "can of worms" - and for what? Sound effects.

If you get some music to play, and can control it (stop, start, pause, change file), then you have all the basics you need. All you have to do then, is decide what event will trigger the control. If you need more than one sound at a time, then you will need more than one sound maker (embed or object). Whether it is a mouseover or a click event, the control action stays the same. There isn't any rocket science between a button click and a link mouseover calling the control. Certainly the control doesn't care what event occurred.

CalifNina
06-03-2003, 11:28 AM
Gil, thks for the reply. I know how forums work and totally understand other possible reasons. Plus my post has not been viewed enough either.

Oh well, all I did was ask for help and explain my situation to try and get some direction. I know it's not rocket science in how it works and once one has it down.

Agree it's work for just having some sound play. I just need to get some basics and am trying teaching myself (or get help thru forums) as I go along. Seeing examples of course always helps.

Thks again for your insight on specific aspects.

Back to the drawing board I go ...