Using sounds with FrontPage 2003

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?
 
S

Stefan B Rusynko

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>


--




|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?
 
T

Trevor L.

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?
 
T

Trevor L.

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>


--




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?
 
T

Thomas A. Rowe

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
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?
 
T

Trevor L.

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
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?
 
S

Stefan B Rusynko

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>
| >
| >
| > --
| >
| > _____________________________________________
| > 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
| > _____________________________________________
| >
| >
| > 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?
|
|
 
T

Thomas A. Rowe

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.
==============================================

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?
 
T

Trevor L.

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
_____________________________________________


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?
 
C

cookoonest

<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
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?
 
T

Trevor L.

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.
==============================================

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?
 
T

Thomas A. Rowe

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>
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?
 
T

Trevor L.

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
<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?
 
S

Stefan B Rusynko

And the Embedded sound files are in the pages displayed in the framed named index_main?

--




| 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>
| >>>
| >>>
| >>> --
| >>>
| >>> _____________________________________________
| >>> 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
| >>> _____________________________________________
| >>>
| >>>
| >>> 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?
|
|
 
T

Thomas A. Rowe

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.
==============================================

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?
 
T

Trevor L.

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
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?
 
T

Trevor L.

Thanks, Thomas

I used this code
<script language=javascript>
MusicSrc = new Array ("minuet.mid","magnificat.mp3")

MusicList = new Array ();
for (var counter in MusicSrc)
{ MusicList[counter].src = MusicSrc[counter]; }
</script>

I get the error:
'musicList[...]' is null or not an object
and the music still plays very slowly

--
Cheers,
Trevor L., WIP (Web Interested Person)
Website: http://tandcl.homemail.com.au
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?
 
G

Guest

To add a small/large part of Windows MediaPlayer, only use this little part
of code:

<EMBED
SRC="Mix1.wav"
HEIGHT=30 WIDTH=79>
Paste as html, and use your own src pointing on your audio/video file.
This will only show a Pause/Start and Stop button + the slider, the music
(or also a video) will start when the site is loading. Try with using
different sizes, the more width the more of the players buttons, more hight -
if you wants to show a video, there is some specifications about the size,
but its better to test some.., if you don't want the slider, just change the
size.
Had to seek a long time to find this very simple but useful way of adding
buttons/player.
It is so simple as it looks (!) - missing it in the online help from MS,
where its not much about audio or video.
Got some video showing on my site, sometimes audio only :
http://Robyn.Makes.It/
Still astonished over what this short code can produce, have seen examples
with loads of scripts just to add a button. You can also add: loop="true"
--
Vonzy


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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top