Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-27-2003, 10:30 PM   PM User | #1
rcarnes
New Coder

 
Join Date: Oct 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
rcarnes is an unknown quantity at this point
Stopping the audio once inside my site

I have posted this in the wrong area, sorry, can someone move it. Thanks


Here's my problem. I have a scenario as follows and I'll just lay it out using a couple of pages as an example..

My main page (index.htm)
Another page, we'll call that gallery.htm

At the top of each page is a header that is a flash animation that plays some music upon entrance to the site (actually each page but I can fix that by calling another flash animation without the sound, no problem....) My problem is that if I hit the home button or the back button it goes back to the main page and calls the header file with the sound. Is there anyway to say that if you're navigating from within the site to NOT play the music ?

Here's the code....

From the index.htm file

<script language="JavaScript" src="header-sound.js"></script>

And from the header-sound.js......

<!-- Begin

document.write('<TABLE cellpadding=0 cellspacing=0 border=0 width="100%" BGCOLOR="#D12428"><tr><td ALIGN="LEFT">');

document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="750" HEIGHT="50" id="logo-nosound" ALIGN="">');
document.write('<PARAM NAME=movie VALUE="mylogo.swf">');
document.write('<PARAM NAME=quality VALUE=high>');
document.write('<PARAM NAME=wmode VALUE=transparent>');
document.write('<PARAM NAME=bgcolor VALUE=#D12428>');
document.write('<EMBED src="mylogo.swf" quality=high wmode=transparent bgcolor=#D12428 WIDTH="750" HEIGHT="50" NAME="mylogo" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
document.write('</EMBED>');
document.write('</OBJECT>');

document.write('</td></tr></table>');

// End -->


Thanks
rcarnes is offline   Reply With Quote
Old 10-28-2003, 02:49 AM   PM User | #2
whammy
Senior Coder

 
Join Date: Jun 2002
Location: 41° 8' 52" N -95° 53' 31" W
Posts: 3,660
Thanks: 0
Thanked 0 Times in 0 Posts
whammy is an unknown quantity at this point
Sorry to be a bit off-topic but the best fix is NOT to play music when you load a site.

Most of the people I know (including me) are currently listening to tunes of their own choice when surfing the web. It's really bad to interfere with their listening pleasure by foisting a tune upon them.

Don't do it in the first place, problem solved.
__________________
Former ASP Forum Moderator - I'm back!

If you can teach yourself how to learn, you can learn anything. ;)
whammy is offline   Reply With Quote
Old 10-28-2003, 01:17 PM   PM User | #3
rcarnes
New Coder

 
Join Date: Oct 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
rcarnes is an unknown quantity at this point
The website is for a band who happens to write and play music. There is an option for the visitor to turn the music off if they wish. Anyways, the way I will do it is by setting a variable the first time through and then while you're navigating within the site the value of this variable can be known.

Problem Solved....

Last edited by WA; 10-28-2003 at 01:22 PM..
rcarnes is offline   Reply With Quote
Old 10-28-2003, 01:30 PM   PM User | #4
Caffeine
Regular Coder

 
Join Date: Mar 2003
Posts: 241
Thanks: 0
Thanked 0 Times in 0 Posts
Caffeine is an unknown quantity at this point
I'm with whammy on this one.
I find it extremely annoying when site's have their own music going on, especially flash-sites that you cannot turn off !!!

I have winamp running 24/7, basically, and I have the volumebar set at 20% or so, so that I can turn it up when my favoriteparts come.
Guess what happens when I enter a site that has music going on ???
IT GETS REAL LOUD !!!


What I think you should do is to rethink this, what does the visitors want, what do they like ? Have an option that can enable music if the visitor want to, I can promise you most visitors would prefer that solution unless they are really desperate for some music!

Imagine if all the prOn-sites had 'sounds' on their sites
lol
Caffeine is offline   Reply With Quote
Old 10-28-2003, 02:00 PM   PM User | #5
rcarnes
New Coder

 
Join Date: Oct 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
rcarnes is an unknown quantity at this point
I agree with you as well that it would probably be better for them to opt to turn the music on, it's just a 45 sec cut of one of the bands songs. It was just the 'tone' of the 'dont do it in the first place, problem solved.' that got me ticked off. I am open to criticism of my thoughts and ideas, I have to go through it during code reviews at work. It's just the delivery of the criticism that got me fired up.

Thanks
rcarnes is offline   Reply With Quote
Old 10-29-2003, 01:26 AM   PM User | #6
whammy
Senior Coder

 
Join Date: Jun 2002
Location: 41° 8' 52" N -95° 53' 31" W
Posts: 3,660
Thanks: 0
Thanked 0 Times in 0 Posts
whammy is an unknown quantity at this point
Sorry if you took that the wrong way, it was definitely intended as constructive criticism.

Actually, I've been playing guitar 16 years, and I'm in a band - and I _still_ wouldn't play any music (even mine) by default when the page loads, just because as a professional web developer and a dedicated web surfer I know how annoying it can be. Now a big flashy banner or a link that is promoted in some way to let the user know you can hear a song by "said band" would be just fine (although perhaps annoying to some people, they would just have to live with it!).

I never did see the original text of your "ticked off" post, since apparently George took care of it (and to be honest I have been too busy maintaining or updating legacy code, apparently originally done by developers that were either rushed or didn't care about maintenance - and the code is so horrible it makes you want to beat up the guy who originally did it)!

But hopefully we are on the same page now.
__________________
Former ASP Forum Moderator - I'm back!

If you can teach yourself how to learn, you can learn anything. ;)

Last edited by whammy; 10-29-2003 at 01:41 AM..
whammy is offline   Reply With Quote
Old 10-29-2003, 02:46 AM   PM User | #7
rcarnes
New Coder

 
Join Date: Oct 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
rcarnes is an unknown quantity at this point
Yep, we are.

If you want, you can check out my sons website to listen to some of their music. Sorry, but there is sound in there. That will change with the new website I am doing now.

Thanks
rcarnes is offline   Reply With Quote
Old 10-29-2003, 02:55 AM   PM User | #8
whammy
Senior Coder

 
Join Date: Jun 2002
Location: 41° 8' 52" N -95° 53' 31" W
Posts: 3,660
Thanks: 0
Thanked 0 Times in 0 Posts
whammy is an unknown quantity at this point
I'll definitely check it out.
__________________
Former ASP Forum Moderator - I'm back!

If you can teach yourself how to learn, you can learn anything. ;)
whammy is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:54 AM.


Advertisement
Log in to turn off these ads.