Solved

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

Posted on 1997-02-21
4
218 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
ID: 1853859
Edited text of question
0
 
LVL 1

Expert Comment

by:vanbasco
ID: 1853860
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
ID: 1853861
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
ID: 1853862
<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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

867 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

22 Experts available now in Live!

Get 1:1 Help Now