Solved

Cross Frame (frameset) javascript problem

Posted on 2009-07-05
4
381 Views
Last Modified: 2012-05-07
Hi, I am using a soundmanager object in a hidden frame on my site.  In this way, i can have continuous music throughout the navigation.  The problem is with the sound control buttons that i use on the visible frame.

If you go to : www.maharajahsroad.com - and enter the site by clicking through the splashpage. you will land on the INDIA page. You can then click the Off and On buttons at the top to stop the sound.  That works.  But if you then proceed to the video page, and try to click the Off button (or On button), it will no longer work.  If you then go back to the INDIA page, (by clicking on the India Link), the same buttons that worked at the start, no longer work.  I dont know what kind of JS erros are causing this, and I'm pretty vexed over the issue.

please help, THANKS!
IN FRAME2:

function stopmusic(){
 

soundManager.pause('mySound');

	//parent.frames['frame1'].mySwap(14);

		window.alert('The site music has been stopped');
 

}
 

IN FRAME1:

<a href="javascript:parent.frames['frame2'].playmusic();"><img src="images/player_on.gif" id="playerOn" onmouseout="mySwap(4)" onmouseover="mySwap(5)" /></a>

<a href="javascript:parent.frames['frame2'].stopmusic();"><img src="images/player_off.gif" id="playerOff" onmouseout="mySwap(6)" onmouseover="mySwap(7)"/></a>

Open in new window

0
Comment
Question by:nbj622
  • 3
4 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 500 total points
ID: 24784332
First change

<a href="javascript:parent.frames['frame2'].playmusic();">
and
<a href="javascript:parent.frames['frame2'].stopmusic();">

to

<a href="#" onClick="parent.frames['frame2'].playmusic(); return false">

<a href="#" onClick="parent.frames['frame2'].stopmusic(); return false">
 
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 24784353
It is because you have another flash taking over in the video page
You should stop the music when the user loads video
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 24784360
Erm. I take that back
Works for me in FF 3.5
0
 

Author Closing Comment

by:nbj622
ID: 31599982
Thanks alot.  Its all about moving from the HREF to the ONCLICK with the return false statement.  It makes all the difference.  Such a simple fix for my headache!  thanks again, it all works now.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Javascript closure 1 36
Javascript create file issue 4 49
Replace &lt; with < 14 57
Angular - break the dataset in chunks? 7 40
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

863 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

20 Experts available now in Live!

Get 1:1 Help Now