Solved

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

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ajaxSubmit is giving me an error 1 54
Company website 6 50
Exchange OWA website Redirection 7 48
WordPress Page Content Lost 2 21
Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
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.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

730 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