Stop a sound

G

Guest

I can start a sound (in this case a 3 minute piece of music) by using
FP_playsound, but I would like to include a button that will allow the viewer
to stop the sound. Any suggestions?
 
T

Trevor L.

BobL said:
I can start a sound (in this case a 3 minute piece of music) by using
FP_playsound, but I would like to include a button that will allow
the viewer to stop the sound. Any suggestions?

You can add this to your page:
<span id="sound"></span>
<input type="button" value="Play/Stop
Music" onclick="playSound()"/>

And this to an external Javascript file or put it in the <head> section with these tags around it
<script type="text/javascript">
</script>

function playSound(fname)
{
if (!fname)
fname = "audio/minuet.mid"
var x = document.getElementById("sound")
x.innerHTML = (!x.innerHTML ) ? '<embed src="' + fname + '" loop=false autostart=true hidden>' : ' '
}

Alter your filename in the function
 
G

Guest

Trevor

Thank you heartily for your help. The code, once I got all the i's crossed
and t's dotted, worked perfectly.

I hope you get this because I have another question. Is there similar code
that will emulate the Windows 'Back' button? I have a situation where I have
a picture pop up and want to click on it to return to the previous page.
Clicking the back button above does the job, but I'd rather have an active
picture.

Any ideas will be appreciated. If you want to send it direct, my email
address is (e-mail address removed). And, when the site is completed and
published, I'll send you the address so that you can see the results of your
handiwork.

Thanks again
Bob
 
T

Trevor L.

BobL said:
Trevor

Thank you heartily for your help. The code, once I got all the i's
crossed and t's dotted, worked perfectly.

I hope you get this because I have another question. Is there
similar code that will emulate the Windows 'Back' button? I have a
situation where I have a picture pop up and want to click on it to
return to the previous page. Clicking the back button above does the
job, but I'd rather have an active picture.

Well, one way to do it is put the image in an html page and add an onclick=
to close

The page would be something like
<html>
<head></head>
<body>
<img src="xxx.jpg" alt="" onclick="window.close()"><br>
Click to close window
</body>
</html>

So instead of linking to xxx.jpg, you link to this page (named, say,
xxx.html)

You will get a message asking whether you want to close this window. There
is a way to avoid this but it doesn't work in all browsers.
 
G

Guest

Trevor

Sounds good EXCEPT:

1. I'm working with EIGHTY pictures. I have them arranged in five pages,
16 thumbnails per page. A click on any thumbnail brings up a larger version
of the picture.

2. I have music that I want to remain running as the viewer goes through
the pictures.

3. Because opening a page stops the music running during the previous page,
I have the picture pages appearing in a frame on a master page. (With me so
far?) Now it is possible to view all (actually) 160 pictures without
disturbing the music.

I haven't tried it, but I guess I could put each of the 80 larger pictures
in separate pages but this whole thing is getting too big as it is. Now that
you see the mess I have, any suggestions?

By the say, the whole thing is for a Jazz society that puts on a summer
festival, with pictures of the shindig and music from a High School band that
performed.

Again, thanks

Bob
 
T

Trevor L.

BobL said:
Trevor

Sounds good EXCEPT:

1. I'm working with EIGHTY pictures. I have them arranged in five
pages, 16 thumbnails per page. A click on any thumbnail brings up a
larger version of the picture.

2. I have music that I want to remain running as the viewer goes
through the pictures.

3. Because opening a page stops the music running during the
previous page, I have the picture pages appearing in a frame on a
master page. (With me so far?) Now it is possible to view all
(actually) 160 pictures without disturbing the music.

I haven't tried it, but I guess I could put each of the 80 larger
pictures in separate pages but this whole thing is getting too big as
it is. Now that you see the mess I have, any suggestions?

By the say, the whole thing is for a Jazz society that puts on a
summer festival, with pictures of the shindig and music from a High
School band that performed.

Again, thanks

Bob

Hmmm.

The only way I can think of to have the music continue while viewing the
pages is for all of the pages to be frames.

While I have used frames a lot, I did not test it to this extent.

I think the 5 pages would all have to be frames within the frameset that has
the music, and the 16 pictures in each would have to opened in frames (but
you say you have done this). I would have to set up a example myself to see
if this works.

I and no expert on this, I am afraid, so let's hope:
you can try it out (set up your own small example)
OR
someone else can advise.
 
G

Guest

Sorry, Trevor:
I wasn't clear about my question. Yes, the frames within frames is working
(surprizingly) perfectly. But my question is this -- Once the viewer has
popped up a large version of one of the thumbnails, is it possible to create
a simple way to close it again without resorting to the window's "Back"
button? Perhaps with a click on the picture? I know I could do it by making
each picture a page, but I already have more than 160 jpg's. I'd hate to add
80 more pages.

Again thanks

Bob

Trevor L. said:
BobL said:
Trevor

Sounds good EXCEPT:

1. I'm working with EIGHTY pictures. I have them arranged in five
pages, 16 thumbnails per page. A click on any thumbnail brings up a
larger version of the picture.

2. I have music that I want to remain running as the viewer goes
through the pictures.

3. Because opening a page stops the music running during the
previous page, I have the picture pages appearing in a frame on a
master page. (With me so far?) Now it is possible to view all
(actually) 160 pictures without disturbing the music.

I haven't tried it, but I guess I could put each of the 80 larger
pictures in separate pages but this whole thing is getting too big as
it is. Now that you see the mess I have, any suggestions?

By the say, the whole thing is for a Jazz society that puts on a
summer festival, with pictures of the shindig and music from a High
School band that performed.

Again, thanks

Bob

Hmmm.

The only way I can think of to have the music continue while viewing the
pages is for all of the pages to be frames.

While I have used frames a lot, I did not test it to this extent.

I think the 5 pages would all have to be frames within the frameset that has
the music, and the 16 pictures in each would have to opened in frames (but
you say you have done this). I would have to set up a example myself to see
if this works.

I and no expert on this, I am afraid, so let's hope:
you can try it out (set up your own small example)
OR
someone else can advise.
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
 
T

Thomas A. Rowe

You would have place each large image on page with a JavaScript function to close the window that
large image is open in.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage
==============================================
Agents Real Estate Listing Network
http://www.NReal.com
==============================================


BobL said:
Sorry, Trevor:
I wasn't clear about my question. Yes, the frames within frames is working
(surprizingly) perfectly. But my question is this -- Once the viewer has
popped up a large version of one of the thumbnails, is it possible to create
a simple way to close it again without resorting to the window's "Back"
button? Perhaps with a click on the picture? I know I could do it by making
each picture a page, but I already have more than 160 jpg's. I'd hate to add
80 more pages.

Again thanks

Bob

Trevor L. said:
BobL said:
Trevor

Sounds good EXCEPT:

1. I'm working with EIGHTY pictures. I have them arranged in five
pages, 16 thumbnails per page. A click on any thumbnail brings up a
larger version of the picture.

2. I have music that I want to remain running as the viewer goes
through the pictures.

3. Because opening a page stops the music running during the
previous page, I have the picture pages appearing in a frame on a
master page. (With me so far?) Now it is possible to view all
(actually) 160 pictures without disturbing the music.

I haven't tried it, but I guess I could put each of the 80 larger
pictures in separate pages but this whole thing is getting too big as
it is. Now that you see the mess I have, any suggestions?

By the say, the whole thing is for a Jazz society that puts on a
summer festival, with pictures of the shindig and music from a High
School band that performed.

Again, thanks

Bob

Hmmm.

The only way I can think of to have the music continue while viewing the
pages is for all of the pages to be frames.

While I have used frames a lot, I did not test it to this extent.

I think the 5 pages would all have to be frames within the frameset that has
the music, and the 16 pictures in each would have to opened in frames (but
you say you have done this). I would have to set up a example myself to see
if this works.

I and no expert on this, I am afraid, so let's hope:
you can try it out (set up your own small example)
OR
someone else can advise.
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
 

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