|
Posted by Neredbojias on 09/18/05 23:20
With neither quill nor qualm, Gaffer quothed:
> I almost have the below script working fine. When the webpage loads you need
> to click on the button to start the music, which it does, and then click on
> the button to turn it off again. However, when you click the 'turn music
> off' button the music does go off, but the button doesn't change back to the
> 'turn music on' one. So the music can't be turned back on again unless you
> refresh the page. Thanks.
>
>
>
>
> --------------------------------------------------------
>
> <script language="JavaScript"><!--
> function musicOff() {
> document.midi.stop()
> }function musicOn() {
> document.midi.play()
> }
>
>
> function changeButton() {
> if (document.onoff.B1.value=='Turn music on')
> {
> document.onoff.B1.value='Turn music off';
> musicOn()
> }
>
>
> else {
> document.onoff.B1.value='Turn music off';
> musicOff()
> }
> }
> //-->
> </script>
> <embed name="midi" src="psychotune.mp3" width="0" height="0"
> autostart="false">
> <form name="onoff">
> <input type="button" value="Turn music on" name="B1"
> onClick="changeButton()" style="color: #000000; background-color: #FFFFFF;
> font-family: Tahoma; font-size: 7pt">
>
> </form>
>
>
> --------------------------------------------------------
To begin with, you're using archaic javascript. Update your code by
using document.getElementById("xxx"). etc., so you can address any real
problem logically.
--
Neredbojias
Contrary to popular belief, it is believable.
Navigation:
[Reply to this message]
|