SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2002
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    image with sound

    I am looking for a simple script that will do the following;

    when an image is clicked, a sound is heard.

    many thanks in advance___Neil.

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    One word: Flash.

    --Vinnie

  3. #3
    American't awestmoreland's Avatar
    Join Date
    Sep 2002
    Location
    Grand Rapids, MI
    Posts
    1,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Excuse the banners, but they do go away:

    Using Javascript

    No Javascript

    The wavs may take some time to load, but hopefully yours will be smaller.

    Only tested this in I.E.


    Andy

  4. #4
    American't awestmoreland's Avatar
    Join Date
    Sep 2002
    Location
    Grand Rapids, MI
    Posts
    1,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Should I have referred to the two versions as:

    "uses inline script"
    & "uses scripted function" ?

    I know how to write it, but I don't know what it is? ;-)


    Andy

  5. #5
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    function Sound(sndAction,sndObj) {
    if (eval(sndObj) != null) {
    if (navigator.appName=='Netscape') {
    eval(sndObj+((sndAction=='stop')?'.stop()':'.play (false)')); }
    else if (eval(sndObj+".FileName")) {
    eval(sndObj+((sndAction=='stop')?'.stop()':'.run()'));}
    }
    }

    to trigger.....
    onMouseOver="Sound('play','document.s6')"

    to stop....
    onMouseOut="Sound('stop','document.s6')"
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •