G
Guest
I would like to add sound as background on all pages but give visitors the
choice to click on a mute button. How can I do it?
choice to click on a mute button. How can I do it?
1) Make sure the sound files are inserted using a Named Embed tag
(usually just before the </body> tag)
<embed src="soundfile.mid" name="theNoise" id="theNoise"
autostart="true" loop="true" width="0" height="0" hidden
align="center">
2) Insert a link to turn the sound off
<a href="javascript:killNoise();">No Sound (or insert an image
here)</a>
3) Insert this one of these scripts in the HEAD section of each page
FOR FRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide It:
function killNoise() {
// The Embedded sound is in a framed page (frame is named "TheFrame")
parent.TheFrame.embeds['theNoise'].stop(); return false;
}
// ShowIt: --></script>
FOR UNFRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide It:
function killNoise() {
// The Embedded sound is in an Unframed Page
document.theNoise.stop();return true;
}
// ShowIt: --></script>
--
Joseph Wasef said:I would like to add sound as background on all pages but give
visitors the choice to click on a mute button. How can I do it?
Interesting,
I too would like to add a button to stop music.
I tried this in a table:
<tr id="music">
<th>
<input type="button" class="top" value="Hide
Player"
onclick="hideit('music')";
parent.index_main.embeds['theNoise'].stop(); return
false;>
<embed src="minuet.mid" id="theNoise" name="theNoise"
width="144" height="45" autostart="true" loop="false"></embed>
</th>
</tr>
where the frame is named index_main and
function hideit(elid)
{document.getElementById(elid).style.display="none"}
It hides the button, but does not stop the music
Any ideas why not?
P.s. I also tried document.top['index_main'].embeds['theNoise'].stop()
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
1) Make sure the sound files are inserted using a Named Embed tag
(usually just before the </body> tag)
<embed src="soundfile.mid" name="theNoise" id="theNoise"
autostart="true" loop="true" width="0" height="0" hidden
align="center">
2) Insert a link to turn the sound off
<a href="javascript:killNoise();">No Sound (or insert an image
here)</a>
3) Insert this one of these scripts in the HEAD section of each page
FOR FRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide It:
function killNoise() {
// The Embedded sound is in a framed page (frame is named "TheFrame")
parent.TheFrame.embeds['theNoise'].stop(); return false;
}
// ShowIt: --></script>
FOR UNFRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide It:
function killNoise() {
// The Embedded sound is in an Unframed Page
document.theNoise.stop();return true;
}
// ShowIt: --></script>
--
Joseph Wasef said:I would like to add sound as background on all pages but give
visitors the choice to click on a mute button. How can I do it?
Trevor L. said:A P.S.
My music sometimes plays very slowly. I assume this has to do with retrieving the file, although
it also happens in my local web.
Is there a way to pre-load it, and will this help?
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Interesting,
I too would like to add a button to stop music.
I tried this in a table:
<tr id="music">
<th>
<input type="button" class="top" value="Hide
Player"
onclick="hideit('music')";
parent.index_main.embeds['theNoise'].stop(); return
false;>
<embed src="minuet.mid" id="theNoise" name="theNoise"
width="144" height="45" autostart="true" loop="false"></embed>
</th>
</tr>
where the frame is named index_main and
function hideit(elid)
{document.getElementById(elid).style.display="none"}
It hides the button, but does not stop the music
Any ideas why not?
P.s. I also tried document.top['index_main'].embeds['theNoise'].stop()
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
1) Make sure the sound files are inserted using a Named Embed tag
(usually just before the </body> tag)
<embed src="soundfile.mid" name="theNoise" id="theNoise"
autostart="true" loop="true" width="0" height="0" hidden
align="center">
2) Insert a link to turn the sound off
<a href="javascript:killNoise();">No Sound (or insert an image
here)</a>
3) Insert this one of these scripts in the HEAD section of each page
FOR FRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide It:
function killNoise() {
// The Embedded sound is in a framed page (frame is named "TheFrame")
parent.TheFrame.embeds['theNoise'].stop(); return false;
}
// ShowIt: --></script>
FOR UNFRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide It:
function killNoise() {
// The Embedded sound is in an Unframed Page
document.theNoise.stop();return true;
}
// ShowIt: --></script>
--
message I would like to add sound as background on all pages but give
visitors the choice to click on a mute button. How can I do it?
If you preload it, then it will slow the page loading of the page you
are calling it from as it loads.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
Trevor L. said:A P.S.
My music sometimes plays very slowly. I assume this has to do with
retrieving the file, although it also happens in my local web.
Is there a way to pre-load it, and will this help?
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Interesting,
I too would like to add a button to stop music.
I tried this in a table:
<tr id="music">
<th>
<input type="button" class="top" value="Hide
Player"
onclick="hideit('music')";
parent.index_main.embeds['theNoise'].stop(); return
false;>
<embed src="minuet.mid" id="theNoise" name="theNoise"
width="144" height="45" autostart="true" loop="false"></embed>
</th>
</tr>
where the frame is named index_main and
function hideit(elid)
{document.getElementById(elid).style.display="none"}
It hides the button, but does not stop the music
Any ideas why not?
P.s. I also tried
document.top['index_main'].embeds['theNoise'].stop() --
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Stefan B Rusynko wrote:
1) Make sure the sound files are inserted using a Named Embed tag
(usually just before the </body> tag)
<embed src="soundfile.mid" name="theNoise" id="theNoise"
autostart="true" loop="true" width="0" height="0" hidden
align="center">
2) Insert a link to turn the sound off
<a href="javascript:killNoise();">No Sound (or insert an image
here)</a>
3) Insert this one of these scripts in the HEAD section of each
page FOR FRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide It:
function killNoise() {
// The Embedded sound is in a framed page (frame is named
"TheFrame") parent.TheFrame.embeds['theNoise'].stop(); return
false; }
// ShowIt: --></script>
FOR UNFRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide It:
function killNoise() {
// The Embedded sound is in an Unframed Page
document.theNoise.stop();return true;
}
// ShowIt: --></script>
--
message I would like to add sound as background on all pages but give
visitors the choice to click on a mute button. How can I do it?
Trevor L. said:Yes, I thought that would be the case, but nonetheless, what is the code I should use to preload a
.mid file as distinct from a .jpg file .
Even if it is the same , could you please jog my memory?
--
Thanks,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
If you preload it, then it will slow the page loading of the page you
are calling it from as it loads.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
Trevor L. said:A P.S.
My music sometimes plays very slowly. I assume this has to do with
retrieving the file, although it also happens in my local web.
Is there a way to pre-load it, and will this help?
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Trevor L. wrote:
Interesting,
I too would like to add a button to stop music.
I tried this in a table:
<tr id="music">
<th>
<input type="button" class="top" value="Hide
Player"
onclick="hideit('music')";
parent.index_main.embeds['theNoise'].stop(); return
false;>
<embed src="minuet.mid" id="theNoise" name="theNoise"
width="144" height="45" autostart="true" loop="false"></embed>
</th>
</tr>
where the frame is named index_main and
function hideit(elid)
{document.getElementById(elid).style.display="none"}
It hides the button, but does not stop the music
Any ideas why not?
P.s. I also tried
document.top['index_main'].embeds['theNoise'].stop() --
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Stefan B Rusynko wrote:
1) Make sure the sound files are inserted using a Named Embed tag
(usually just before the </body> tag)
<embed src="soundfile.mid" name="theNoise" id="theNoise"
autostart="true" loop="true" width="0" height="0" hidden
align="center">
2) Insert a link to turn the sound off
<a href="javascript:killNoise();">No Sound (or insert an image
here)</a>
3) Insert this one of these scripts in the HEAD section of each
page FOR FRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide It:
function killNoise() {
// The Embedded sound is in a framed page (frame is named
"TheFrame") parent.TheFrame.embeds['theNoise'].stop(); return
false; }
// ShowIt: --></script>
FOR UNFRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide It:
function killNoise() {
// The Embedded sound is in an Unframed Page
document.theNoise.stop();return true;
}
// ShowIt: --></script>
--
message I would like to add sound as background on all pages but give
visitors the choice to click on a mute button. How can I do it?
Create the script in your pages
<script language="JavaScript" language="JavaScript"><!-- Hide It:
function killNoise() { parent.index_main.embeds['theNoise'].stop();
return false; } // ShowIt: --></script>
Then add the button as
<form>
<input type="button" class="top" value="Stop Player"
onclick="killNoise();hideit('music')";> </form>
_________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
_____________________________________________
Trevor L. said:Interesting,
I too would like to add a button to stop music.
I tried this in a table:
<tr id="music">
<th>
<input type="button" class="top" value="Hide
Player"
onclick="hideit('music')";
parent.index_main.embeds['theNoise'].stop(); return
false;>
<embed src="minuet.mid" id="theNoise" name="theNoise"
width="144" height="45" autostart="true" loop="false"></embed>
</th>
</tr>
where the frame is named index_main and
function hideit(elid)
{document.getElementById(elid).style.display="none"}
It hides the button, but does not stop the music
Any ideas why not?
P.s. I also tried
document.top['index_main'].embeds['theNoise'].stop() --
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
1) Make sure the sound files are inserted using a Named Embed tag
(usually just before the </body> tag)
<embed src="soundfile.mid" name="theNoise" id="theNoise"
autostart="true" loop="true" width="0" height="0" hidden
align="center">
2) Insert a link to turn the sound off
<a href="javascript:killNoise();">No Sound (or insert an image
here)</a>
3) Insert this one of these scripts in the HEAD section of each page
FOR FRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide It:
function killNoise() {
// The Embedded sound is in a framed page (frame is named
"TheFrame") parent.TheFrame.embeds['theNoise'].stop(); return false;
}
// ShowIt: --></script>
FOR UNFRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide It:
function killNoise() {
// The Embedded sound is in an Unframed Page
document.theNoise.stop();return true;
}
// ShowIt: --></script>
--
message I would like to add sound as background on all pages but give
visitors the choice to click on a mute button. How can I do it?
Thomas A. Rowe said:It would be the same code use to preload images. I never preload items, so
I can not provide you with any code. Just do a search for JavaScript
Preload Scripts.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
Trevor L. said:Yes, I thought that would be the case, but nonetheless, what is the code
I should use to preload a .mid file as distinct from a .jpg file .
Even if it is the same , could you please jog my memory?
--
Thanks,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
If you preload it, then it will slow the page loading of the page you
are calling it from as it loads.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
A P.S.
My music sometimes plays very slowly. I assume this has to do with
retrieving the file, although it also happens in my local web.
Is there a way to pre-load it, and will this help?
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Trevor L. wrote:
Interesting,
I too would like to add a button to stop music.
I tried this in a table:
<tr id="music">
<th>
<input type="button" class="top" value="Hide
Player"
onclick="hideit('music')";
parent.index_main.embeds['theNoise'].stop(); return
false;>
<embed src="minuet.mid" id="theNoise" name="theNoise"
width="144" height="45" autostart="true" loop="false"></embed>
</th>
</tr>
where the frame is named index_main and
function hideit(elid)
{document.getElementById(elid).style.display="none"}
It hides the button, but does not stop the music
Any ideas why not?
P.s. I also tried
document.top['index_main'].embeds['theNoise'].stop() --
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Stefan B Rusynko wrote:
1) Make sure the sound files are inserted using a Named Embed tag
(usually just before the </body> tag)
<embed src="soundfile.mid" name="theNoise" id="theNoise"
autostart="true" loop="true" width="0" height="0" hidden
align="center">
2) Insert a link to turn the sound off
<a href="javascript:killNoise();">No Sound (or insert an image
here)</a>
3) Insert this one of these scripts in the HEAD section of each
page FOR FRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide It:
function killNoise() {
// The Embedded sound is in a framed page (frame is named
"TheFrame") parent.TheFrame.embeds['theNoise'].stop(); return
false; }
// ShowIt: --></script>
FOR UNFRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide It:
function killNoise() {
// The Embedded sound is in an Unframed Page
document.theNoise.stop();return true;
}
// ShowIt: --></script>
--
message I would like to add sound as background on all pages but give
visitors the choice to click on a mute button. How can I do it?
<script language=javascript>
<!--
ImageSrc = new Array (
"image1.jpg", "image2.jpg", "image3.gif", "image4.gif")
ImageList = new Array ();
for (counter in ImageSrc) {
ImageList[counter] = new Image();
ImageList[counter].src = ImageSrc[counter];
}
// -->
</SCRIPT>
Thomas A. Rowe said:It would be the same code use to preload images. I never preload
items, so I can not provide you with any code. Just do a search for
JavaScript Preload Scripts.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
Trevor L. said:Yes, I thought that would be the case, but nonetheless, what is the
code I should use to preload a .mid file as distinct from a .jpg
file . Even if it is the same , could you please jog my memory?
--
Thanks,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Thomas A. Rowe wrote:
If you preload it, then it will slow the page loading of the page
you are calling it from as it loads.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
A P.S.
My music sometimes plays very slowly. I assume this has to do with
retrieving the file, although it also happens in my local web.
Is there a way to pre-load it, and will this help?
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Trevor L. wrote:
Interesting,
I too would like to add a button to stop music.
I tried this in a table:
<tr id="music">
<th>
<input type="button" class="top" value="Hide
Player"
onclick="hideit('music')";
parent.index_main.embeds['theNoise'].stop();
return false;>
<embed src="minuet.mid" id="theNoise" name="theNoise"
width="144" height="45" autostart="true" loop="false"></embed>
</th>
</tr>
where the frame is named index_main and
function hideit(elid)
{document.getElementById(elid).style.display="none"}
It hides the button, but does not stop the music
Any ideas why not?
P.s. I also tried
document.top['index_main'].embeds['theNoise'].stop() --
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Stefan B Rusynko wrote:
1) Make sure the sound files are inserted using a Named Embed
tag (usually just before the </body> tag)
<embed src="soundfile.mid" name="theNoise" id="theNoise"
autostart="true" loop="true" width="0" height="0" hidden
align="center">
2) Insert a link to turn the sound off
<a href="javascript:killNoise();">No Sound (or insert an
image here)</a>
3) Insert this one of these scripts in the HEAD section of each
page FOR FRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide
It: function killNoise() {
// The Embedded sound is in a framed page (frame is named
"TheFrame") parent.TheFrame.embeds['theNoise'].stop(); return
false; }
// ShowIt: --></script>
FOR UNFRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide
It: function killNoise() {
// The Embedded sound is in an Unframed Page
document.theNoise.stop();return true;
}
// ShowIt: --></script>
--
message
I would like to add sound as background on all pages but give
visitors the choice to click on a mute button. How can I do it?
Trevor L. said:Thanks, cookoonest
I will keep this to use for images. (I think it would be useful in a few places)
How do I modify the code for Music files, e.g. .mid files
I assume I don't use: ImageList[counter].src = ImageSrc[counter];
%-(
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
<script language=javascript>
<!--
ImageSrc = new Array (
"image1.jpg", "image2.jpg", "image3.gif", "image4.gif")
ImageList = new Array ();
for (counter in ImageSrc) {
ImageList[counter] = new Image();
ImageList[counter].src = ImageSrc[counter];
}
// -->
</SCRIPT>
Thomas A. Rowe said:It would be the same code use to preload images. I never preload
items, so I can not provide you with any code. Just do a search for
JavaScript Preload Scripts.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
Yes, I thought that would be the case, but nonetheless, what is the
code I should use to preload a .mid file as distinct from a .jpg
file . Even if it is the same , could you please jog my memory?
--
Thanks,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Thomas A. Rowe wrote:
If you preload it, then it will slow the page loading of the page
you are calling it from as it loads.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
A P.S.
My music sometimes plays very slowly. I assume this has to do with
retrieving the file, although it also happens in my local web.
Is there a way to pre-load it, and will this help?
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Trevor L. wrote:
Interesting,
I too would like to add a button to stop music.
I tried this in a table:
<tr id="music">
<th>
<input type="button" class="top" value="Hide
Player"
onclick="hideit('music')";
parent.index_main.embeds['theNoise'].stop();
return false;>
<embed src="minuet.mid" id="theNoise" name="theNoise"
width="144" height="45" autostart="true" loop="false"></embed>
</th>
</tr>
where the frame is named index_main and
function hideit(elid)
{document.getElementById(elid).style.display="none"}
It hides the button, but does not stop the music
Any ideas why not?
P.s. I also tried
document.top['index_main'].embeds['theNoise'].stop() --
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Stefan B Rusynko wrote:
1) Make sure the sound files are inserted using a Named Embed
tag (usually just before the </body> tag)
<embed src="soundfile.mid" name="theNoise" id="theNoise"
autostart="true" loop="true" width="0" height="0" hidden
align="center">
2) Insert a link to turn the sound off
<a href="javascript:killNoise();">No Sound (or insert an
image here)</a>
3) Insert this one of these scripts in the HEAD section of each
page FOR FRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide
It: function killNoise() {
// The Embedded sound is in a framed page (frame is named
"TheFrame") parent.TheFrame.embeds['theNoise'].stop(); return
false; }
// ShowIt: --></script>
FOR UNFRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide
It: function killNoise() {
// The Embedded sound is in an Unframed Page
document.theNoise.stop();return true;
}
// ShowIt: --></script>
--
message
I would like to add sound as background on all pages but give
visitors the choice to click on a mute button. How can I do it?
Trevor, you can name the functions anything, so ImageList should
still work for .mid files
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
Trevor L. said:Thanks, cookoonest
I will keep this to use for images. (I think it would be useful in a
few places) How do I modify the code for Music files, e.g. .mid files
I assume I don't use: ImageList[counter].src = ImageSrc[counter];
%-(
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
<script language=javascript>
<!--
ImageSrc = new Array (
"image1.jpg", "image2.jpg", "image3.gif",
"image4.gif") ImageList = new Array ();
for (counter in ImageSrc) {
ImageList[counter] = new Image();
ImageList[counter].src = ImageSrc[counter];
}
// -->
</SCRIPT>
It would be the same code use to preload images. I never preload
items, so I can not provide you with any code. Just do a search for
JavaScript Preload Scripts.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
Yes, I thought that would be the case, but nonetheless, what is
the code I should use to preload a .mid file as distinct from a
.jpg file . Even if it is the same , could you please jog my
memory? --
Thanks,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Thomas A. Rowe wrote:
If you preload it, then it will slow the page loading of the page
you are calling it from as it loads.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
A P.S.
My music sometimes plays very slowly. I assume this has to do
with retrieving the file, although it also happens in my local
web. Is there a way to pre-load it, and will this help?
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Trevor L. wrote:
Interesting,
I too would like to add a button to stop music.
I tried this in a table:
<tr id="music">
<th>
<input type="button" class="top" value="Hide
Player"
onclick="hideit('music')";
parent.index_main.embeds['theNoise'].stop();
return false;>
<embed src="minuet.mid" id="theNoise" name="theNoise"
width="144" height="45" autostart="true"
loop="false"></embed> </th>
</tr>
where the frame is named index_main and
function hideit(elid)
{document.getElementById(elid).style.display="none"}
It hides the button, but does not stop the music
Any ideas why not?
P.s. I also tried
document.top['index_main'].embeds['theNoise'].stop() --
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Stefan B Rusynko wrote:
1) Make sure the sound files are inserted using a Named Embed
tag (usually just before the </body> tag)
<embed src="soundfile.mid" name="theNoise" id="theNoise"
autostart="true" loop="true" width="0" height="0" hidden
align="center">
2) Insert a link to turn the sound off
<a href="javascript:killNoise();">No Sound (or insert an
image here)</a>
3) Insert this one of these scripts in the HEAD section of
each page FOR FRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide
It: function killNoise() {
// The Embedded sound is in a framed page (frame is named
"TheFrame") parent.TheFrame.embeds['theNoise'].stop(); return
false; }
// ShowIt: --></script>
FOR UNFRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide
It: function killNoise() {
// The Embedded sound is in an Unframed Page
document.theNoise.stop();return true;
}
// ShowIt: --></script>
--
in message
I would like to add sound as background on all pages but give
visitors the choice to click on a mute button. How can I do
it?
Trevor L. said:Thomas,
It wasn't so much the names of the functions that I was concerned about, but the fact that there
is a statement
ImageList[counter].src = ImageSrc[counter];
When I am not using Image files, wouldn't the suffix .src be incorrect?
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Trevor, you can name the functions anything, so ImageList should
still work for .mid files
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
Trevor L. said:Thanks, cookoonest
I will keep this to use for images. (I think it would be useful in a
few places) How do I modify the code for Music files, e.g. .mid files
I assume I don't use: ImageList[counter].src = ImageSrc[counter];
%-(
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
cookoonest wrote:
<script language=javascript>
<!--
ImageSrc = new Array (
"image1.jpg", "image2.jpg", "image3.gif",
"image4.gif") ImageList = new Array ();
for (counter in ImageSrc) {
ImageList[counter] = new Image();
ImageList[counter].src = ImageSrc[counter];
}
// -->
</SCRIPT>
It would be the same code use to preload images. I never preload
items, so I can not provide you with any code. Just do a search for
JavaScript Preload Scripts.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
Yes, I thought that would be the case, but nonetheless, what is
the code I should use to preload a .mid file as distinct from a
.jpg file . Even if it is the same , could you please jog my
memory? --
Thanks,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Thomas A. Rowe wrote:
If you preload it, then it will slow the page loading of the page
you are calling it from as it loads.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
A P.S.
My music sometimes plays very slowly. I assume this has to do
with retrieving the file, although it also happens in my local
web. Is there a way to pre-load it, and will this help?
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Trevor L. wrote:
Interesting,
I too would like to add a button to stop music.
I tried this in a table:
<tr id="music">
<th>
<input type="button" class="top" value="Hide
Player"
onclick="hideit('music')";
parent.index_main.embeds['theNoise'].stop();
return false;>
<embed src="minuet.mid" id="theNoise" name="theNoise"
width="144" height="45" autostart="true"
loop="false"></embed> </th>
</tr>
where the frame is named index_main and
function hideit(elid)
{document.getElementById(elid).style.display="none"}
It hides the button, but does not stop the music
Any ideas why not?
P.s. I also tried
document.top['index_main'].embeds['theNoise'].stop() --
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Stefan B Rusynko wrote:
1) Make sure the sound files are inserted using a Named Embed
tag (usually just before the </body> tag)
<embed src="soundfile.mid" name="theNoise" id="theNoise"
autostart="true" loop="true" width="0" height="0" hidden
align="center">
2) Insert a link to turn the sound off
<a href="javascript:killNoise();">No Sound (or insert an
image here)</a>
3) Insert this one of these scripts in the HEAD section of
each page FOR FRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide
It: function killNoise() {
// The Embedded sound is in a framed page (frame is named
"TheFrame") parent.TheFrame.embeds['theNoise'].stop(); return
false; }
// ShowIt: --></script>
FOR UNFRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide
It: function killNoise() {
// The Embedded sound is in an Unframed Page
document.theNoise.stop();return true;
}
// ShowIt: --></script>
--
in message
I would like to add sound as background on all pages but give
visitors the choice to click on a mute button. How can I do
it?
And the Embedded sound files are in the pages displayed in the framed
named index_main?
--
Trevor L. said:Thanks, Stefan.
I had thought of placing the function outside the onclick ="" and
then calling it. But I didn't try it until now.
I now have this
<head>
....
<script type="text/javascript">
function killNoise() { parent.index_main.embeds['theNoise'].stop();
return false; }
</script>
...
</head>
<body>
....
<input type="button" class="top" value="Hide
Player"
onclick="killNoise();hideit('music')";>
<embed src="minuet.mid" id="theNoise" name="theNoise"
width="144" height="45" autostart="true" loop="false"></embed>
...
When I click I get an error
'parent.index_main.embeds.theNoise' is null or nor an object
The button doesn't hide and the music doesn't stop
I also enclosed <input > ... </embed> in <form></form> and it made
no difference.
I can't see why the object is not recognised. I am using IE6 under
XP Home SP2
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Create the script in your pages
<script language="JavaScript" language="JavaScript"><!-- Hide It:
function killNoise() {
parent.index_main.embeds['theNoise'].stop(); return false; } //
ShowIt: --></script>
Then add the button as
<form>
<input type="button" class="top" value="Stop Player"
onclick="killNoise();hideit('music')";> </form>
_________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
_____________________________________________
Interesting,
I too would like to add a button to stop music.
I tried this in a table:
<tr id="music">
<th>
<input type="button" class="top" value="Hide
Player"
onclick="hideit('music')";
parent.index_main.embeds['theNoise'].stop();
return false;>
<embed src="minuet.mid" id="theNoise" name="theNoise"
width="144" height="45" autostart="true" loop="false"></embed>
</th>
</tr>
where the frame is named index_main and
function hideit(elid)
{document.getElementById(elid).style.display="none"}
It hides the button, but does not stop the music
Any ideas why not?
P.s. I also tried
document.top['index_main'].embeds['theNoise'].stop() --
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Stefan B Rusynko wrote:
1) Make sure the sound files are inserted using a Named Embed tag
(usually just before the </body> tag)
<embed src="soundfile.mid" name="theNoise" id="theNoise"
autostart="true" loop="true" width="0" height="0" hidden
align="center">
2) Insert a link to turn the sound off
<a href="javascript:killNoise();">No Sound (or insert an image
here)</a>
3) Insert this one of these scripts in the HEAD section of each
page
FOR FRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide It:
function killNoise() {
// The Embedded sound is in a framed page (frame is named
"TheFrame") parent.TheFrame.embeds['theNoise'].stop(); return
false; }
// ShowIt: --></script>
FOR UNFRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide It:
function killNoise() {
// The Embedded sound is in an Unframed Page
document.theNoise.stop();return true;
}
// ShowIt: --></script>
--
message I would like to add sound as background on all pages but give
visitors the choice to click on a mute button. How can I do it?
The only function is [counter], your .mid is still a "src". The best
option is to try it and see if it works.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
Trevor L. said:Thomas,
It wasn't so much the names of the functions that I was concerned
about, but the fact that there is a statement
ImageList[counter].src = ImageSrc[counter];
When I am not using Image files, wouldn't the suffix .src be
incorrect? --
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Trevor, you can name the functions anything, so ImageList should
still work for .mid files
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
Thanks, cookoonest
I will keep this to use for images. (I think it would be useful in
a few places) How do I modify the code for Music files, e.g. .mid
files I assume I don't use: ImageList[counter].src =
ImageSrc[counter];
%-(
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
cookoonest wrote:
<script language=javascript>
<!--
ImageSrc = new Array (
"image1.jpg", "image2.jpg", "image3.gif",
"image4.gif") ImageList = new Array ();
for (counter in ImageSrc) {
ImageList[counter] = new Image();
ImageList[counter].src = ImageSrc[counter];
}
// -->
</SCRIPT>
It would be the same code use to preload images. I never preload
items, so I can not provide you with any code. Just do a search
for JavaScript Preload Scripts.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
Yes, I thought that would be the case, but nonetheless, what is
the code I should use to preload a .mid file as distinct from a
.jpg file . Even if it is the same , could you please jog my
memory? --
Thanks,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Thomas A. Rowe wrote:
If you preload it, then it will slow the page loading of the
page you are calling it from as it loads.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
A P.S.
My music sometimes plays very slowly. I assume this has to do
with retrieving the file, although it also happens in my local
web. Is there a way to pre-load it, and will this help?
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Trevor L. wrote:
Interesting,
I too would like to add a button to stop music.
I tried this in a table:
<tr id="music">
<th>
<input type="button" class="top" value="Hide
Player"
onclick="hideit('music')";
parent.index_main.embeds['theNoise'].stop();
return false;>
<embed src="minuet.mid" id="theNoise" name="theNoise"
width="144" height="45" autostart="true"
loop="false"></embed> </th>
</tr>
where the frame is named index_main and
function hideit(elid)
{document.getElementById(elid).style.display="none"}
It hides the button, but does not stop the music
Any ideas why not?
P.s. I also tried
document.top['index_main'].embeds['theNoise'].stop() --
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Stefan B Rusynko wrote:
1) Make sure the sound files are inserted using a Named
Embed tag (usually just before the </body> tag)
<embed src="soundfile.mid" name="theNoise" id="theNoise"
autostart="true" loop="true" width="0" height="0" hidden
align="center">
2) Insert a link to turn the sound off
<a href="javascript:killNoise();">No Sound (or insert an
image here)</a>
3) Insert this one of these scripts in the HEAD section of
each page FOR FRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!--
Hide It: function killNoise() {
// The Embedded sound is in a framed page (frame is named
"TheFrame") parent.TheFrame.embeds['theNoise'].stop();
return false; }
// ShowIt: --></script>
FOR UNFRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!--
Hide It: function killNoise() {
// The Embedded sound is in an Unframed Page
document.theNoise.stop();return true;
}
// ShowIt: --></script>
--
"Joseph Wasef" <Joseph (e-mail address removed)>
wrote in message
I would like to add sound as background on all pages but
give visitors the choice to click on a mute button. How
can I do it?
Trevor L. said:Correct, Stefan
The frame index_main had this code
<embed src="minuet.mid" id="theNoise" name="theNoise"
width="144" height="45" autostart="true" loop="false"></embed>
and the music plays in this frame
I thought of using
top.document.index_main.embeds['theNoise'].stop();
I tried a second ago, and it didn't fail (i.e. no jscript error message) but
the music didn't stop.
This is confusing
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
And the Embedded sound files are in the pages displayed in the framed
named index_main?
--
Trevor L. said:Thanks, Stefan.
I had thought of placing the function outside the onclick ="" and
then calling it. But I didn't try it until now.
I now have this
<head>
....
<script type="text/javascript">
function killNoise() { parent.index_main.embeds['theNoise'].stop();
return false; }
</script>
...
</head>
<body>
....
<input type="button" class="top" value="Hide Player"
onclick="killNoise();hideit('music')";>
<embed src="minuet.mid" id="theNoise" name="theNoise"
width="144" height="45" autostart="true" loop="false"></embed>
...
When I click I get an error
'parent.index_main.embeds.theNoise' is null or nor an object
The button doesn't hide and the music doesn't stop
I also enclosed <input > ... </embed> in <form></form> and it made
no difference.
I can't see why the object is not recognised. I am using IE6 under
XP Home SP2
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Stefan B Rusynko wrote:
Create the script in your pages
<script language="JavaScript" language="JavaScript"><!-- Hide It:
function killNoise() {
parent.index_main.embeds['theNoise'].stop(); return false; } //
ShowIt: --></script>
Then add the button as
<form>
<input type="button" class="top" value="Stop Player"
onclick="killNoise();hideit('music')";> </form>
_________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
_____________________________________________
Interesting,
I too would like to add a button to stop music.
I tried this in a table:
<tr id="music">
<th>
<input type="button" class="top" value="Hide Player"
onclick="hideit('music')";
parent.index_main.embeds['theNoise'].stop();
return false;>
<embed src="minuet.mid" id="theNoise" name="theNoise"
width="144" height="45" autostart="true" loop="false"></embed>
</th>
</tr>
where the frame is named index_main and
function hideit(elid)
{document.getElementById(elid).style.display="none"}
It hides the button, but does not stop the music
Any ideas why not?
P.s. I also tried
document.top['index_main'].embeds['theNoise'].stop() --
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
Stefan B Rusynko wrote:
1) Make sure the sound files are inserted using a Named Embed tag
(usually just before the </body> tag)
<embed src="soundfile.mid" name="theNoise" id="theNoise"
autostart="true" loop="true" width="0" height="0" hidden
align="center">
2) Insert a link to turn the sound off
<a href="javascript:killNoise();">No Sound (or insert an image
here)</a>
3) Insert this one of these scripts in the HEAD section of each
page
FOR FRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide It:
function killNoise() {
// The Embedded sound is in a framed page (frame is named
"TheFrame") parent.TheFrame.embeds['theNoise'].stop(); return
false; }
// ShowIt: --></script>
FOR UNFRAMED PAGES USE:
<script language="JavaScript" language="JavaScript"><!-- Hide It:
function killNoise() {
// The Embedded sound is in an Unframed Page
document.theNoise.stop();return true;
}
// ShowIt: --></script>
--
message I would like to add sound as background on all pages but give
visitors the choice to click on a mute button. How can I do it?