Click to See Complete Forum and Search --> : i need this urgently...


tanfwc
11-14-2003, 11:12 PM
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...

tanfwc
11-15-2003, 05:55 AM
Originally posted by tanfwc
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...

bump...please...help...i really need the script...

ColdSteel
11-15-2003, 10:58 AM
This just might work...if not give me a holler and I'll figure something else out... here's the code, and then I'll explain more...

<script language="javascript" type="text/javascript">
mywav = new Array("cool.wav", "totallycool.wav","Wow.wav","reallywow.wav")

wavcount = mywav.length

function choosewav() {

randomNum = Math.floor((Math.random() * wavcount))

document.thewave.src = mywav[randomNum]
}

}


</script>

<body>

</body>
<BGsound src="placeholder.wav" name="thewave">

now in the array you would put your .avi's...then make a .avi that is blank...name it "placeholder" and place in the page in the bgsound tag...it should work...but have not tested...works with random images...if you need help just reply that you do and I'll try to respond a little better...hehe..

ColdSteel
11-15-2003, 11:04 AM
sorry...but can't figure out the cookie part exactly...

tanfwc
11-15-2003, 06:40 PM
Originally posted by ColdSteel
sorry...but can't figure out the cookie part exactly...

nvm...it ok that i dun put the cookie...thanx...for the code...i will try it out later...

tanfwc
11-15-2003, 06:54 PM
strange...nothing is being play...erm...btw, the song format i wan to play is mid...

ColdSteel
11-16-2003, 01:02 PM
well, about the mid...I just meant that you put the mid filenames in place of the wav's....did you substitute your names of the files correctly in the code? I am not really that good with Javascript...wasn't exactly sure if this code would work or not...um...if you substituted the names of the files correctly and did you make a blank mid and put it in the bgsound tag? In theory, for this code to work it would have to have a blank mid in that tag...if you follow me...hope this helped clarify...

ColdSteel
11-17-2003, 11:55 AM
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...

tanfwc
11-21-2003, 07:51 PM
Originally posted by ColdSteel
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...

thanx very much for the help...

i have the following mid i wan to play in my webby...

248.mid
an_jing.mid
Angel.mid
Ji Mo De Ji Jie.mid
qing_tian.mid
wave.mid
yu jian.mid

erm...what program to use to create a blank mid? dun mind creating one for me?

thanx a million...

ColdSteel
11-22-2003, 07:10 PM
Sure...I'll do the code sometime this weekend....Probably get it back on Monday...HOPEFULLY it works...hehe....maybe it will....if all else fails....ask Pyro...:D ...Seriously, I'll get on it....

ColdSteel
11-22-2003, 07:13 PM
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....

tanfwc
11-23-2003, 12:27 AM
Originally posted by ColdSteel
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....

thanx...

ColdSteel
11-24-2003, 01:50 PM
Here's some code that should work...if not just give me a buzz on the forum and I'll try to figure something ELSE out...hehe...hope it works...

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<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>

I don't think that it is going to need a blank mid so I just used one of the names that you placed in the thread....

tanfwc
11-24-2003, 06:21 PM
thanx for the code...i will try it out later...

tanfwc
11-24-2003, 06:29 PM
erm...the code just cannot work...i create a index.html file in the directory of where the mid is store...and it cannot play...strange...thanx...

ColdSteel
11-24-2003, 08:06 PM
oops, made mistake....will give the changed code tommorrow..hehe...

tanfwc
11-24-2003, 08:16 PM
Originally posted by ColdSteel
oops, made mistake....will give the changed code tommorrow..hehe...
ty

ColdSteel
11-25-2003, 04:23 PM
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....:D ...

tanfwc
11-25-2003, 06:43 PM
Originally posted by ColdSteel
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....:D ...

mi try later..ty

tanfwc
11-25-2003, 09:02 PM
hmm...still cannot works...ty very much....anyone can help me ?

tanfwc
11-30-2003, 08:19 PM
bump