SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict eddiembabaali's Avatar
    Join Date
    Mar 2001
    Location
    USA, Philadelphia
    Posts
    206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am doing a wedsite where the client wants a background sound on the first page which i did. The problem is he also wants a welcome audio message on each page. I am having problems with the index page in particular because I do not figure out how to stop the background sound and play the welcome message.

    Here is a snippet of my code:

    [code]
    <script language="javascript" type="text/javascript">
    <!--
    if ( navigator.appName == 'Netscape' ) {
    document.write( '<embed src="sound.mid" autostart="true" hidden="true" loop="0" name="bgsound"></embed>' );
    } else if ( navigator.appName == 'Microsoft Internet Explorer' ) {
    document.write( '<bgsound src="sound.mid" autostart="true" loop="infinite" name="bgsound">' );
    } else document.write( '<bgsound src="sound.mid" autostart="true" loop="infinite" name="bgsound"><embed src="sound.mid" autostart="true" hidden="true" loop="0" name="bgsound"></embed>' );
    //-->
    </script>

    [code]

    I tried to do something like this <a href="#" onclick="javascript:document.bgsound.stop()">STOP</a> and still the sound could not stop. Anybody know how I can use an event to stop the bgsound and start the welcome message sound ? I will really appreciate your help ..
    cd pub \r; more beer

    Eddie

  2. #2
    Happy Holidays !! Paul S's Avatar
    Join Date
    Mar 2001
    Location
    Mexico
    Posts
    1,287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi

    For NN write

    Code:
    <EMBED SRC="sound.mid" WIDTH="35" HEIGHT="23" CONTROLS="stopbutton" NAME="bgsound">
    Paul

  3. #3
    Happy Holidays !! Paul S's Avatar
    Join Date
    Mar 2001
    Location
    Mexico
    Posts
    1,287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi again,

    Why you have loop attribute set to infinite if the user's browser is IE and set to 0 if is NN?

    Does your client want that the background music sounds all the time?

    Paul


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
  •