Geocities Webpage Creator (HTML)/HELPME :'( html stuff
Expert: Erik - 7/6/2002
Questionno one here would answer my question
my answer always expired when i needed it
this time i'll do this right
i need code for mouseover with sound and without sound
ALSO
a code for a button....whatzitcalls...i dont know. a button when i click it everytime it pops up saying different things each time
thx i see you're an absolute smartie
answer ASAP!
Answer#1) MOUSEOVER WITH SOUND
*** Put this code right after the <BODY> tag:
(make sure you change the image location and the sound file location)
<SCRIPT LANGUAGE="JavaScript">
function themousegoeson()
{
MPlyr.Play()
theimage.src="THE SECOND IMAGE.GIF"
}
function themousegoesoff()
{
MPlyr.Stop()
theimage.src="THE FIRST IMAGE.GIF"
}
</SCRIPT>
<OBJECT ID="MPlyr" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" WIDTH="0" HEIGHT="0">
<PARAM NAME="FileName" VALUE="SOUNDFILE.WAV">
<PARAM NAME="AutoRewind" VALUE="true">
<PARAM NAME="Balance" VALUE="0">
<PARAM NAME="AutoStart" VALUE="false">
<PARAM NAME="ShowDisplay" VALUE="false">
<PARAM NAME="ShowControls" VALUE="false">
<PARAM NAME="ShowTracker" VALUE="false">
<PARAM NAME="PlayCount" VALUE="1">
</OBJECT>
*** Put this whereever the image should be:
(make sure you change the image location)
<IMG SRC="THE FIRST IMAGE.GIF" ONMOUSEOVER="themousegoeson()" ONMOUSEOUT="themousegoesoff()" NAME="theimage">
#2) MOUSE OVER WITHOUT SOUND
*** Put this whereever the image should be:
(make sure you replace the image locations)
<IMG SRC="THE FIRST IMAGE.GIF" ONMOUSEOVER="theimage.src='THE SECOND IMAGE.GIF'" ONMOUSEOUT="theimage.src='THE FIRST IMAGE.GIF'" NAME="theimage">
#3) RANDOM SAYING
*** Put this code in the <HEAD> part of the document:
(replace the sayings)
<SCRIPT LANGUAGE="JavaScript">
function doitnow()
{
y = 0;
ad = new Array(y);
ad[y++] = "Random Saying 1"
ad[y++] = "Random Saying 2"
ad[y++] = "Random Saying 3"
x = Math.floor(Math.random()*(y));
alert(ad[x])
}
</SCRIPT>
*** Put this where the button should go (between the <BODY> tags)
(all you have to do is change the text on the button)
<FORM>
<INPUT TYPE="button" ONCLICK="doitnow()" VALUE="click me">
</FORM>
I hope this is what you were looking for!
Erik
teshack.com