Solved

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

Posted on 1997-02-21
4
221 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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

791 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