Solved

Questions about frames, gifs, midi:  Do I use javascript?

Posted on 1997-02-21
4
212 Views
Last Modified: 2013-12-25
Hi,

**Here's what I wanna do:**

(there are 3 frames)

1-  The user click on a link in frame 3.
2-  An image (animated gif) loads in frame 1.
3-  When the gif in frame 1 is loaded completely,
    a midi loads in frame 2.
4-  When the midi in frame 2 is over, a new gif loads in     frame 1.

I guess I'll have to use javascript to do that.  The problem is that I don't know javascript.  Is there a source on the web where I could find what I need?


Thanks,

Guillaume
lafranc@cam.org
http://www.cam.org/~lafranc
0
Comment
Question by:lafranc
4 Comments
 

Author Comment

by:lafranc
Comment Utility
Edited text of question
0
 
LVL 1

Expert Comment

by:vanbasco
Comment Utility
Hello,

well what you want is too difficult to solve without Java/Javascript.
But I'm not sure whether this will work with your Midi, since I'm not
aware of Javascripts midi functions. I'll check out and let you know.
0
 
LVL 5

Accepted Solution

by:
Trevor013097 earned 120 total points
Comment Utility
Okay this is a long answer but it does what you want and works perfectly on a Javascript enabled browser.

It requires 1 page to setup and then the other 6 pages I have done are the first 3 pages which display simply 2 blanks and a START button.  The next 3 are the first image, the sound and then the second image.

The second image is loaded after a timeout as this is the only way of doing the load of the second image at the end of the midi file.  Insure that enough time is given to download and run the midi.

All references to images and sound should be replaced with your own file names.

Okay here are the pages.  All the pages are seperated by a filename strip.


<----------setup.html-------------->
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>

<FRAMESET COLS="33%,34%,33%">
   <FRAME SRC="frame1.html" NAME="frame1">
   <FRAME SRC="frame2.html" NAME="frame2">
   <FRAME SRC="frame3.html" NAME="frame3">
</FRAMESET>
<NOFRAMES>
  <!-- Place text here that will be seen only by those browsers which do not support frames -->
</NOFRAMES>
</HTML>
<--------------end of setup.html------------>

<--------------frame1.html------------------>
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>

<BODY BGCOLOR="#FFFFFF">

This frame will display images

</BODY>
</HTML>
<--------------end of frame1.html------------->

<-------------frame2.html--------------->
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>

<BODY BGCOLOR="#FFFFFF">

This is where the sound is loaded and played.
</BODY>
</HTML>
<---------------end of frame2.html------------------>

<--------------frame3.html------------------>
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>

<SCRIPT LANGUAGE="Javascript">
<!--
function image1()
{
   
      parent.frame1.location = "frame1a.html";
}
</SCRIPT>

<BODY BGCOLOR="#FFFFFF">

<A HREF="" onclick="image1()">START</A>

</BODY>
</HTML>
<-------------------end of frame3.html---------------->

<-----------------frame1a.html------------------->
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<SCRIPT LANGUAGE="Javascript">
<!--
function music()
{
   
      parent.frame2.location = "frame2a.html";
}
</SCRIPT>

<BODY BGCOLOR="#FFFFFF" onload="music()">

<IMG SRC="img0001.gif"><BR>

</BODY>
</HTML>
<----------------end of frame1a.html--------------->

<---------------frame2a.html--------------------->
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>

<SCRIPT LANGUAGE="Javascript">
<!--
function PlaySound()
{

      window.location="music.mid"
image2()
}

function image2()
{
      setTimeout("parent.frame1.location = 'frame1b.html'", 5000);

}
</SCRIPT>

<BODY BGCOLOR="#FFFFFF" onload="PlaySound()">

</BODY>
</HTML>
<-------------------end of frame2a.html------------->

<------------------frame1b.html----------------->
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>

<BODY BGCOLOR="#FFFFFF">

<IMG SRC="img00002.gif">

</BODY>
</HTML>
<--------------------end of frame1b.html--------------->

A good refernce for Javascript is

http://www.webreference.com/javascript/


Any problems then please contact me

tmunday@pcmaritime.co.uk

0
 
LVL 3

Expert Comment

by:RM032397
Comment Utility
<A HREF="" onclick="image1()">START</A>

could cause some problems where browsers execute the HREF before the onClick the alternative is :

<A HREF="javascript:image1()">START</A>

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now