Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Rollover Images, Additional Image and Sound

    I have rollover images that also change and additional image:

    if (document.images) {
    image1on = new Image();
    image1on.src = "myimage1on.gif";

    image1off = new Image();
    image1off.src = "myimage1off.gif";

    otherImageDefault = new Image();
    otherImageDefault.src = "default.gif";

    otherImage1 = new Image();
    otherImage1.src = "myimagebanner1.gif";

    }

    <td width=393 bgcolor="#0000A8"><a href="mylink.html" onMouseOver="changeImages('image1', 'image1on', 'otherImage', 'otherImage1')" onMouseOut="changeImages('image1', 'image1off', 'otherImage', 'otherImageDefault')"><img name="image1" src="myimage1on.gif" alt="myAltTag" width=81 height=16 border=0></a>

    I would like to add sound to this onMouseOver with the following:

    <embed name="wav01" src="audio.wav" autostart="false" mastersound hidden="true" loop="true" volume=100 width=0 height=0>

    and

    ;javascript:jsPlay('wav01');return true;

    and

    ;javascript:jsStop('wav01');return true;

    I tried this below, but it gives me an error. What is the correct way to do this?

    <td width=393 bgcolor="#0000A8"><a href="mylink.html" onMouseOver="changeImages('image1', 'image1on', 'otherImage', 'otherImage1');javascript:jsPlay('wav01');return true;" onMouseOut="changeImages('image1', 'image1off', 'otherImage', 'otherImageDefault');javascript:jsStop('wav01');return true;"><img name="image1" src="myimage1on.gif" alt="myAltTag" width=81 height=16 border=0></a>

    Thank you


  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    If the jsplay and jsstop functions work, you should be able to do this
    Code:
    <a href="mylink.html" onMouseOver="changeImages('image1', 'image1on', 'otherImage', 'otherImage1');jsPlay('wav01');" onMouseOut="changeImages('image1', 'image1off', 'otherImage', 'otherImageDefault');jsStop('wav01');"><img name="image1" src="myimage1on.gif" alt="myAltTag" width=81 height=16 border=0></a>
    Lose the javascript: stuff its doing nothing and not needed.

  • #3
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I tried it and it's returning a Runtime Error still. I have used these jsPlay & jsStop commands with other rollovers, but not with rollovers with an additional image.

    I don't know if the jsPlay and jsStop are in the right position within the MouseOver line.

    Thanks,
    Joe

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    They are fine, I think it has something to do with your jsplay and jsstop functions, post the scripts for those.

  • #5
    Regular Coder
    Join Date
    Dec 2005
    Posts
    346
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by _Aerospace_Eng_
    If the jsplay and jsstop functions work, you should be able to do this
    Code:
    <a href="mylink.html" onMouseOver="changeImages('image1', 'image1on', 'otherImage', 'otherImage1');jsPlay('wav01');" onMouseOut="changeImages('image1', 'image1off', 'otherImage', 'otherImageDefault');jsStop('wav01');"><img name="image1" src="myimage1on.gif" alt="myAltTag" width=81 height=16 border=0></a>
    Lose the javascript: stuff its doing nothing and not needed.
    Does the code:
    PHP Code:
    jsPlay('wav01');
    need to be something like this below or what ever the file format is? Don't it need the 3 digit file format on it?
    PHP Code:
    jsPlay('wav01.mdi');


  •  

    Posting Permissions

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