Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie question :)

Status
Not open for further replies.

SimoBk

Technical User
Aug 14, 2002
10
CA
Hi all,

I have a site with frames with embed quicktime movies. After reading the quicktime documentation, I know that I can control Quicktime with Javascript, here's the example they give:

---------------------
<A HREF=&quot;java script:playIt(document.movieName);&quot;>Play</a>

<A HREF=&quot;java script:StopIt(document.movieName);&quot;>Stop</a>
---------------------

This code is supposed to work perfectly with links placed on the same page as the embedded quicktime, but...

1. The controls are not on the same frame as the embedded quicktime. The control should be on the &quot;main&quot; frame while the embedded quicktime is on the &quot;right&quot; frame.
2. The controls shouldn't be links. I need the &quot;STOP&quot; function to happen when a specific page is loaded, and then the &quot;PLAY&quot; function to happen when that same page is unloaded.

This may seem hard to understand, so I'll explain to you the main function of this:

The site is composed of 4 frames: &quot;left&quot;, &quot;menu&quot;, &quot;main&quot; and &quot;right&quot;. You can see it at
The &quot;right&quot; frame contains an embedded quicktime that plays background music as soon as we enter the site.

Some links will open a video on the &quot;main&quot; frame.

When the video page is loaded, it should automatically stop the music played by the controller in the &quot;right&quot; frame.

When the video page is unloaded, it should automatically resume the music played by the controller in the &quot;left&quot; frame.

I hope it is clear, now the question is: How do I run these code when loading/unloading the page, and how do I make them affect the &quot;right&quot; frame and not the &quot;main&quot; frame.

Bonus question: &quot;Is it possible to do the same thing if I load the videos in a pop-up window instead of the 'main' frame?&quot;

Thanks all for your help, really appreciated...

Simo

Motherboard: Asus CUSL2
Proc: PIII 733MHz
Mem: 256Mb SDRam PC133
Video: ATI All In Wonder 128 Pro (IRQ11)
Sound: SB Live Value (IRQ9 shared with modem and both LAN cards, it's always been like that but it used to work b4)
LAN+Modem: 10/100PCI - 10PCI - 56K
IDE: DVD16x - CD.RW 12.10.32 - 3½ - Master 30Gb 7200rpm - Sla
 
>>The controls are not on the same frame as the embedded quicktime. The control should be on the &quot;main&quot; frame while the embedded quicktime is on the &quot;right&quot; frame.

You can reference a function in a separate frame the same way you would reference any other property of that frame. instead of
[tt]PlayIt(document.movieName)[/tt]
you would use
[tt]parent.right.PlayIt(parent.right.document.movieName)[/tt]

>>The controls shouldn't be links. I need the &quot;STOP&quot; function to happen when a specific page is loaded, and then the &quot;PLAY&quot; function to happen when that same page is unloaded.

You can use the individual document's onload and onunload events to control this:
[tt]<body onload=&quot;parent.right.StopIt(parent.right.document.movieName);&quot; onunload=&quot;parent.right.PlayIt(parent.right.document.movieName)&quot;>[/tt]

>>Bonus question: &quot;Is it possible to do the same thing if I load the videos in a pop-up window instead of the 'main' frame?&quot;

Yes. As long as you retain a handle to the popup window, you can communicate with it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top