* * * The Warring States of NPF Thread * * *
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Thread : HTML, Java, CSS help needed
Started at 04-30-2010 07:30 PM by Nique
Visit at http://www.nuklearforums.com/showthread.php?t=37787
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
[Post 1]
Author : Nique
Date : 04-30-2010 07:30 PM
Thread Title : HTML, Java, CSS help needed
I'm trying to create a soundboard like so (http://www.instantsfun.es/) and am trying to do it without flash.
I'm hitting a wall with the JavaScript. You can see by the code below that I've gotten some test images to preform rollover effects just fine;
HTML
My Webpage
CSS
/* stylesheet.css - a simple style sheet */
a.rollover1 {
display: block;
width: 100px;
height:100px;
text-decoration: none;
background: url("test-button.png");
}
a.rollover1:active {
background-position: -100px 0;
}
a.rollover2 {
display: block;
width: 100px;
height:100px;
text-decoration: none;
background: url("test-button2.png");
}
a.rollover2:active {
background-position: -100px 0;
}
.displace {
position: absolute;
left: -5000px;
}
But to get sounds to play when I click on those images, I'm trying to include something like this;
JavaScript
Click here to play sound
I'm super novice esspecially with the JavaScript. When I try to incorporate the Java it doesn't seem to work. And, I mean, just so we're clear on exactly how novice I am, I'm still not 100% sure where the 'script' tags are supposed to go.
Help/ examples would be much appreciated.
EDIT: Edited per Fifthfiend's advice. Will post with results after my next attempt.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
[Post 2]
Author : Fifthfiend
Date : 04-30-2010 08:26 PM
I think you want sound.wav, not sound, in your onClick action.
EDIT No wait sorry I think you want sound1, it's supposed to match the name from your embed.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
[Post 3]
Author : Nique
Date : 04-30-2010 08:37 PM
Hm. It is arranged like so...
My Webpage
Click here to play sound ...
But still no dice.
And yes my filepath is correct and yes I am actually using a file named 'sound.wav' that makes for reals noise. I'm using IE7 if that helps.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
[Post 4]
Author : Fifthfiend
Date : 04-30-2010 09:03 PM
Huh. It apparently works fine (http://www.awesomesplosion.com/test/screwinaround/nique.html) in Firefox / IE8 / Chrome so IDK. Does that link work for you?
EDIT: Does this (http://www.awesomesplosion.com/test/screwinaround/nique2.html)? Maybe the problem isn't the javascript so much as whatever plugin you have/don't have installed?
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
[Post 5]
Author : Nique
Date : 04-30-2010 09:58 PM
FFFFFFFFFFFFFFFFFuuuu...
Yeah that'd be it but I am checking it on another computer. Unfortunatly the fact that the OTHER computer doesn't have the right plugin means that all the computers that will be using it don't have it either.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
[Post 6]
Author : Fifthfiend
Date : 04-30-2010 10:02 PM
Do you have quicktime installed? That's what mine uses to play 'em.
But yeah if this is some sort of serious project or w/ev you probably shouldn't count on people having whatever dumb plugin.
Which I guess is why every media site uses Flash, it's the dumb plugin that everybody has!
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
[Post 7]
Author : Nique
Date : 04-30-2010 10:08 PM
Yeah and basically any way to make this work that I have researched needs the plugin to play it right off the page... or else there is some insane magic way to do it in CSS.
Thanks for the help though! At least now I can stop wasting my time with USELESS JAVASCRIPT! GAH!
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
[Post 8]
Author : Fifthfiend
Date : 04-30-2010 10:16 PM
I guess if you wanna stick to doing it in java/html could figure out how to set it up to detect whether people have X plugin and if they don't be like "HEY YOU DON'T HAVE X PLUGIN YOU GOTTA GO GET DAT OR THIS SITE WON'T DO SHIT"
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
[Post 9]
Author : Nique
Date : 05-01-2010 12:01 AM
Here's a sort of weird thing. Off your site, it works. But if I try to play it locally out of just 'My Documents' or whatever, it brings up the Active-X error and then won't play at all. Could it have to do with the file types I'm using? It's just a .wav I found from the OS so it should be a thang...
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
[Post 10]
Author : Fifthfiend
Date : 05-01-2010 03:33 AM
------
Nique;1035721 says:
Here's a sort of weird thing. Off your site, it works. But if I try to play it locally out of just 'My Documents' or whatever, it brings up the Active-X error and then won't play at all. Could it have to do with the file types I'm using? It's just a .wav I found from the OS so it should be a thang...
------
Do you have spaces in your filenames anywhere?
EDIT "My Documents" so lol, yeah. I bet that's what's fucking it up.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
[Post 11]
Author : Nique
Date : 05-01-2010 03:31 PM
Changed the file path so it's running from 'C:\mywebsite\index.html' and same problems. I am baffled.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
[Post 12]
Author : synkr0nized
Date : 05-01-2010 04:19 PM
Thread Title : Embeds!
------
Fifthfiend;1035684 says:
Huh. It apparently works fine (http://www.awesomesplosion.com/test/screwinaround/nique.html) in Firefox / IE8 / Chrome so IDK. Does that link work for you?
------
That does nothing in Firefox.
The page that directly embeds it does. Are you confident that script is correct?
This works (http://webdesign.about.com/od/sound/a/play_sound_oncl.htm) in Firefox and IE, though. I suspect it is because of slight browser engine differences and Fifth's script setting the embed's autostart to false, preventing it from playing, whereas this person's waits until the rollover or click action occurs to bring the embed into existence, causing it to play.
However, Fifth's works in MSIE.
For cross-browser support, though, you may want to leave a dummy div that gets re-written with the embed on clicks/mouseovers as users navigate your soundboard.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Downloaded from The Warring States of NPF (http://www.nuklearforums.com) at 11-27-2024 04:59 AM.