Open multiple files

hello, I’d like to open both a sound file and an image at once.
Any help?

I may be misunderstanding you, as this doesn’t seem to be a javascript thing.

Wouldn’t you just have both in your mark-up?

Of course it might depend on what you mean by “same time”. I can see where if one or the other were larger or took longer to download they wouldn’t be synchronous.

What are you after?

Thanks Mittineague for the response. This is my pastime. If it isn’t challenging I pass. Following is my code:

<html>
<!--<head>
<script type="text/javascript">
function delayer(){
    window.location = emailget.html"
}
</script>
</head>
<body onLoad="setTimeout('delayer()', 1000)">
<h2>Prepare to be redirected!</h2>-->

<body bgcolor="#c3c3c3">><center><b><i>
<font size=10 color=red>
Come on in, the dog seldom bites</font></i><br>
<img src="swinggate_enter.gif" height=200 width=300 border=0><br>

<!--<a href="dingdong.mp3"><img src="cathead.jpg" bgcolor="#c3c3c3"height=100 width=100 border=0></a>-->
<a href="emailget.html"><img src="cathead.jpg" height=100 width=100 border=0></a>

</center></body></html>

I hope you can help, if not, no bigee.

If I understand, you want to preload the image and sound files before the page displays?

I think this is entirely possible but IMHO it would be better to show vistiors something straight away. Supposedly the click-out for slow loading pages is a very short amount of time.

Not really wanting to preload, the delay is to assure that the sound(a doorbell) sounds before the html
file (emailget.html) is seen. This initiated by clicking the doorbell at gate. Thanks for engaging.

So the flow is like

[list=1][]page with gate and doorbell images loads
[
]visitor clicks on doobell
[]sound file plays
[
]new page loads[/list]

or is it more like a “splash” page thing like

[list=1][]visitor clicks link on a page
[
]page with gate and doorbell images loads and sound file plays
[*]new page loads[/list]

  1. page with gate and doorbell images loads

  2. visitor clicks on doobell

  3. sound file plays

  4. new page loads

It seems if the “bell” were a midi or wav file it would be fairly light weight and not take any more time to load than an image file would.
But I see dingdong.mp3
Is this a large file for what I imagine is a relatively simple sound? (or the Winchester chime by the full London Philharmonic Orchestra ?) :wink:

I think the real problem is to not go to the new page until after the sound finishes playing. i.e. it wouldn’t make much sense to start playing it only to have it cut short when the page unloads.

AFAIK users can control the volume of sounds and indeed whether or not they even play, but not how fast they play.

So unless it is a heavy weight file not fully loading in, I think if you hijacked the link’s click event default, give enough time to ensure it completes playing, then redirect to the new page it would work.

Hi y’all, What I have is a closed gate with
a doorbell before it. If all goes well, clicking the doorbell rings the doorbell,
the gate swings open and seconds later the target file opens. If only…
the only issue is that this doesn’t advance after the bell. Also, I’d like not to see the popup
box. Everything else works great. Anyone want to play?

 
<html><body bgcolor="#ccffff"><center><b><i><p><p><p> 
<font size=+3 color=red>
Through this portal lies email starting points </FONT></i><p><p><p><font size=+3>
<img src="swing_gate.jpg" height=200 width=300 border=0><br>
<a href="dingdong.wav"><img src="cathead.jpg" bgcolor="#c3c3c3"height=100 width=100 border=0></a>
</font></center></body></html>



The audio element has a bunch of useful properties and events that can be used to detect certain information while an audio file is playing. You could take a look at that and determine a way to achieve your end goal.

You would attach an event listener to react to the end of the dingdong audo file. Once the end comes you would than play and add the behavior for the door swinging open. Than when that is done programmatically click the link to open the file.