Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Cross Frame (frameset) javascript problem

Posted on 2009-07-05
4
Medium Priority
?
413 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 2000 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

Independent Software Vendors: 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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

926 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