Menu
i need some script that random play mid…i got around 5 midi…it will be better if i can put cookies to their comp…so next time when they visit my webby…the same song will not be play…
[i]Originally posted by tanfwc [/i]
[B]i need some script that random play mid...i got around 5 midi...it will be better if i can put cookies to their comp...so next time when they visit my webby...the same song will not be play... [/B][/QUOTE]
wavcount = mywav.length
function choosewav() {
randomNum = Math.floor((Math.random() * wavcount))
document.thewave.src = mywav[randomNum]
}
}
[i]Originally posted by ColdSteel [/i]
[B]sorry...but can't figure out the cookie part exactly... [/B][/QUOTE]
[i]Originally posted by ColdSteel [/i]
[B]Tell you what...if you give me the filenames of your mid's I will try to make some custom code for you, and get a blank .mid....I guess since I don't have a job I can take time out like this...hehe...but I'll try my best...if for some reason after I make the code for it stil doesn't work...maybe try asking Pyro....he seems to know quite a few of the answers...or any of the moderators for that matter... [/B][/QUOTE]
[i]Originally posted by ColdSteel [/i]
[B]Oh, I'll make the mid...it might even work with any mid...what this code is doing (Or attempting to do) is change the source of the mid with a random number....so it might work with a blank one or a normal one...I'll figure it out.... [/B][/QUOTE]
wavcount = mywav.length
function choosewav() {
randomNum = Math.floor((Math.random() * wavcount))
document.themid.src = mywav[randomNum]
}
}
[i]Originally posted by ColdSteel [/i]
[B]oops, made mistake....will give the changed code tommorrow..hehe... [/B][/QUOTE]
[i]Originally posted by ColdSteel [/i]
[B]There...hopefully now it's fixed....
<script language="javascript" type="text/javascript">
mywav = new Array("248.mid" ; "an_jing.mid" ; "Angel.mid" ; "Ji Mo De Ji Jie.mid" ; "qing_tian.mid" ; "wave.mid" ; "yu jian.mid ")
wavcount = mywav.length
function choosewav() {
randomNum = Math.floor((Math.random() * wavcount))
document.themid.src = mywav[randomNum]
}
}
</script>
<body>
</body>
<BGsound src="wav.mid" name="themid">
</html>
If it doesn't work, I am sorry, but I can't think of a different way to do it....? ... [/B][/QUOTE]
0.1.9 — BETA 5.18