Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how to see a movie in another frame using javascript

Posted on 2003-11-27
2
Medium Priority
?
284 Views
Last Modified: 2010-05-18
Hi,
I have two frames on my webpage.
In frame1 I have my links : link1, link2 etc. and I would like to use javascript so that when you click on link1 in frame1 you see a video movie1 in frame2 with eventually the embed tag using windows media player. and link2 will show movie2 etc.
How can I do that?
Thank you
0
Comment
Question by:ilungachris
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
Timbo87 earned 1000 total points
ID: 9835253
Using this frameset:
<frameset cols="134,*">
<frame name="frame1" noresize src="page1.html">
<frame name="frame2" noresize src="page2.html">
</frameset>

frame1 is the left frame and frame2 is the right frame.

page1.html looks like this:

<script language="JavaScript" type="text/javascript">
function showMovie(moviename, moviewidth, movieheight)
{
var a = "<embed src=\"" + moviename + "\" width=" + moviewidth + " height=" + movieheight+" autostart=true>"
top.frame2.document.open()
top.frame2.document.write(a)
top.frame2.document.close()
}
</script>
<a href="#" onClick = "showMovie('movie1.mpg',640,480)">Movie 1</a>
<br>
<a href="#" onClick = "showMovie('movie2.mpg',320,240)">Movie 2</a>


As long as you copy the entire script tag (from <script> to </script>), you can call the showMovie function like this:
<a href="#" onClick = "showMovie('movie1.mpg',640,480)">Movie 1</a>
file.mpg is the name of the file.
640 is the width of the movie viewer in pixels.
480 is the height of the movie viewer in pixels.
It will output this to the right frame (frame2).

If you have any other questions or if you'd like further customization or explanation, please ask.
0
 

Author Comment

by:ilungachris
ID: 9842168
thank you it works!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
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).

722 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