www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > General

    General Discussion and support for your general issues associated with web design.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 12-28-2002, 10:08 PM
    Kaisa's Avatar
    Kaisa Kaisa is offline
    Ice Kitsunian RPG Gamer
     
    Join Date: Dec 2002
    Location: Saint Louis , Missouri
    Posts: 157
    Arrow Add Sound to mouse overs

    I already got the mouseover script for javascript now all i need to know is how to add sound to it (Look At File !)
    Attached Files
    File Type: txt mousescript.txt (1.4 KB, 271 views)
    __________________
    Many people already feared the staff because they banned there *** !
    Reply With Quote
      #2  
    Old 12-28-2002, 10:22 PM
    Zach Elfers Zach Elfers is offline
    Registered User
     
    Join Date: Nov 2002
    Posts: 631
    What if you did:

    <head>
    <script language="JavaScript" type="text/JavaScript">

    img1 = new Image(height, width);
    img1.src = "img1.ext";
    img2 = new Image(height, width);
    img2.src = "img2.ext";

    </script>
    </head>
    <body>
    <a href="nowhere.html" onMouseOver="document.image1.src = 'img2.ext';playSound('file.wav', '1');" onMouseOut = "document.image1.src = 'img1.ext';playSound('quiet.wav', '1');"><img name="image1" src="img1.ext"></a>

    <script language="JavaScript" type="text/JavaScript">

    function playSound(file, loop);
    document.writeln("<bgsound src=\"" + file + "\" loop=\"" + loop + "\">");
    return true;
    }

    </script>
    </body>
    Reply With Quote
      #3  
    Old 12-28-2002, 10:37 PM
    Kaisa's Avatar
    Kaisa Kaisa is offline
    Ice Kitsunian RPG Gamer
     
    Join Date: Dec 2002
    Location: Saint Louis , Missouri
    Posts: 157
    Post

    I found something like that in the HTMl book i had it had the following code

    <HTML><HEAD><TITLE>Llumi's big cat dreams<TITLE>

    <SCRIPT LANGUAGE="javascript">

    <!--

    littlecat = new image(143,83)
    littlecat.src = "Real.jpg"
    bigcat = new image(143,83)
    bigcat.src = "dream.jpg"

    // -->

    </script></head></body>

    Point at Llumi to see what she's thinking.

    <a href="nowhere.html"
    Onmouseover = "document.catpic.src = bigcat.src"
    Onmouseout = "document.catpic.src = littlecat.src">

    <img src="real.jpg" name="catpic" width=143 height=83>

    </a>

    </body><html>

    Thats how it showed it in my book but it never worked !
    __________________
    Many people already feared the staff because they banned there *** !
    Reply With Quote
      #4  
    Old 12-28-2002, 10:41 PM
    Kaisa's Avatar
    Kaisa Kaisa is offline
    Ice Kitsunian RPG Gamer
     
    Join Date: Dec 2002
    Location: Saint Louis , Missouri
    Posts: 157
    Quote:
    Originally posted by Zach Elfers
    What if you did:

    \
    /

    function playSound(file, loop);
    document.writeln("<bgsound src=\"" + file + "\" loop=\"" + loop + "\">");
    return true;
    }

    </script>
    </body>
    i was just wondering why you need all those "\" ?
    __________________
    Many people already feared the staff because they banned there *** !
    Reply With Quote
      #5  
    Old 12-29-2002, 12:59 AM
    Beach Bum Beach Bum is offline
    Registered User
     
    Join Date: Nov 2002
    Posts: 396
    Quote:
    document.writeln("<bgsound src=\"" + file + "\" loop=\"" + loop + "\">");
    I have not tried the whole script to see if the idea works, but I do know that bgsound only works in IE.
    Reply With Quote
      #6  
    Old 06-20-2003, 11:31 PM
    Kaisa's Avatar
    Kaisa Kaisa is offline
    Ice Kitsunian RPG Gamer
     
    Join Date: Dec 2002
    Location: Saint Louis , Missouri
    Posts: 157
    Quote:
    Originally posted by Zach Elfers
    What if you did:

    <head>
    <script language="JavaScript" type="text/JavaScript">

    img1 = new Image(height, width);
    img1.src = "img1.ext";
    img2 = new Image(height, width);
    img2.src = "img2.ext";

    </script>
    </head>
    <body>
    <a href="nowhere.html" onMouseOver="document.image1.src = 'img2.ext';playSound('file.wav', '1');" onMouseOut = "document.image1.src = 'img1.ext';playSound('quiet.wav', '1');"><img name="image1" src="img1.ext"></a>

    <script language="JavaScript" type="text/JavaScript">

    function playSound(file, loop);
    document.writeln("<bgsound src=\"" + file + "\" loop=\"" + loop + "\">");
    return true;
    }

    </script>
    </body>
    But won't you need to make the images with the script like document.img.src=".ext." ?
    __________________
    Many people already feared the staff because they banned there *** !
    Reply With Quote
      #7  
    Old 06-20-2003, 11:44 PM
    PeOfEo's Avatar
    PeOfEo PeOfEo is offline
    Data Center Troll
     
    Join Date: Nov 2002
    Location: Auburn, AL
    Posts: 10,037
    <A HREF="YourPage.html" onMouseOver="playSound(0)" onMouseOut="stopSound(0)">Move mouse over to play sound</A>

    your link

    <script LANGUAGE="JavaScript"><!--


    var aySound = new Array();

    aySound[0] = "laser.wav";


    document.write('<BGSOUND ID="auIEContainer">')
    IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
    NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
    ver4 = IE||NS? 1:0;
    onload=auPreload;

    function auPreload() {
    if (!ver4) return;
    if (NS) auEmb = new Layer(0,window);
    else {
    Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
    document.body.insertAdjacentHTML("BeforeEnd",Str);
    }
    var Str = '';
    for (i=0;i<aySound.length;i++)
    Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
    if (IE) auEmb.innerHTML = Str;
    else {
    auEmb.document.open();
    auEmb.document.write(Str);
    auEmb.document.close();
    }
    auCon = IE? document.all.auIEContainer:auEmb;
    auCon.control = auCtrl;
    }
    function auCtrl(whSound,play) {
    if (IE) this.src = play? aySound[whSound]:'';
    else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
    }
    function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
    function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }
    //-->
    </script>


    I just saw this on another site. Ok it will play a sound 'lazer.wav' whenver you roll a mouse over a link with the event handler code in it. It also preloads these sounds.
    Its pretty nifty give it a try. You should just be able to combine your event handlers though to get the desired affect with an image roll over too though.

    Last edited by PeOfEo; 06-20-2003 at 11:48 PM.
    Reply With Quote
      #8  
    Old 06-21-2003, 01:33 PM
    Kaisa's Avatar
    Kaisa Kaisa is offline
    Ice Kitsunian RPG Gamer
     
    Join Date: Dec 2002
    Location: Saint Louis , Missouri
    Posts: 157
    Quote:
    Originally posted by PeOfEo
    <A HREF="YourPage.html" onMouseOver="playSound(0)" onMouseOut="stopSound(0)">Move mouse over to play sound</A>

    your link

    <script LANGUAGE="JavaScript"><!--


    var aySound = new Array();

    aySound[0] = "laser.wav";


    document.write('<BGSOUND ID="auIEContainer">')
    IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
    NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
    ver4 = IE||NS? 1:0;
    onload=auPreload;

    function auPreload() {
    if (!ver4) return;
    if (NS) auEmb = new Layer(0,window);
    else {
    Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
    document.body.insertAdjacentHTML("BeforeEnd",Str);
    }
    var Str = '';
    for (i=0;i<aySound.length;i++)
    Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
    if (IE) auEmb.innerHTML = Str;
    else {
    auEmb.document.open();
    auEmb.document.write(Str);
    auEmb.document.close();
    }
    auCon = IE? document.all.auIEContainer:auEmb;
    auCon.control = auCtrl;
    }
    function auCtrl(whSound,play) {
    if (IE) this.src = play? aySound[whSound]:'';
    else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
    }
    function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
    function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }
    //-->
    </script>


    I just saw this on another site. Ok it will play a sound 'lazer.wav' whenver you roll a mouse over a link with the event handler code in it. It also preloads these sounds.
    Its pretty nifty give it a try. You should just be able to combine your event handlers though to get the desired affect with an image roll over too though.

    http://net4tv.com/voice/Story.cfm?storyID=3413 i found another way to do a sound mouse over there !
    __________________
    Many people already feared the staff because they banned there *** !
    Reply With Quote
      #9  
    Old 06-21-2003, 01:44 PM
    PeOfEo's Avatar
    PeOfEo PeOfEo is offline
    Data Center Troll
     
    Join Date: Nov 2002
    Location: Auburn, AL
    Posts: 10,037
    that doesnt pre-load though There are three or four similar but different methods you can use I guess. Similar but bifferent... I guess thats a new peoism right there lol similar but different.
    Reply With Quote
      #10  
    Old 01-30-2006, 01:48 AM
    JohnnyGT JohnnyGT is offline
    Registered User
     
    Join Date: Jan 2006
    Posts: 1
    Question mouse over sound

    Hi there !!

    can someone please help me do a mouse sound over for my avatar.
    i am not the best of computer literate but know little bits from seing other work on it !

    my avatar is a boy on a trike(3 wheeler) doing a drift slide and would like it to have sound if my friends move their mouse over it like tires squeling !!

    could you please help me or do something with it and i could link it to my club site ?

    tis is the avatar as i got on this site.
    http://i21.photobucket.com/albums/b2...max9/av-34.gif

    thanks and could you please respond to me vai email at littlemax9@yahoo.com

    regards
    Pieter

    Last edited by JohnnyGT; 01-30-2006 at 01:56 AM.
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    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
    Forum Jump


    All times are GMT -5. The time now is 05:37 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.