/    Sign up×
Community /Pin to ProfileBookmark

i need this urgently…

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…

to post a comment
JavaScript

20 Comments(s)

Copy linkTweet thisAlerts:
@tanfwcauthorNov 15.2003 — [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]


bump...please...help...i really need the script...
Copy linkTweet thisAlerts:
@ColdSteelNov 15.2003 — 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..
Copy linkTweet thisAlerts:
@ColdSteelNov 15.2003 — sorry...but can't figure out the cookie part exactly...
Copy linkTweet thisAlerts:
@tanfwcauthorNov 16.2003 — [i]Originally posted by ColdSteel [/i]

[B]sorry...but can't figure out the cookie part exactly... [/B][/QUOTE]


nvm...it ok that i dun put the cookie...thanx...for the code...i will try it out later...
Copy linkTweet thisAlerts:
@tanfwcauthorNov 16.2003 — strange...nothing is being play...erm...btw, the song format i wan to play is mid...
Copy linkTweet thisAlerts:
@ColdSteelNov 16.2003 — 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...
Copy linkTweet thisAlerts:
@ColdSteelNov 17.2003 — 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...
Copy linkTweet thisAlerts:
@tanfwcauthorNov 22.2003 — [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]


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...
Copy linkTweet thisAlerts:
@ColdSteelNov 23.2003 — 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...? ...Seriously, I'll get on it....
Copy linkTweet thisAlerts:
@ColdSteelNov 23.2003 — 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....
Copy linkTweet thisAlerts:
@tanfwcauthorNov 23.2003 — [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]


thanx...
Copy linkTweet thisAlerts:
@ColdSteelNov 24.2003 — 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....
Copy linkTweet thisAlerts:
@tanfwcauthorNov 25.2003 — thanx for the code...i will try it out later...
Copy linkTweet thisAlerts:
@tanfwcauthorNov 25.2003 — 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...
Copy linkTweet thisAlerts:
@ColdSteelNov 25.2003 — oops, made mistake....will give the changed code tommorrow..hehe...
Copy linkTweet thisAlerts:
@tanfwcauthorNov 25.2003 — [i]Originally posted by ColdSteel [/i]

[B]oops, made mistake....will give the changed code tommorrow..hehe... [/B][/QUOTE]

ty
Copy linkTweet thisAlerts:
@ColdSteelNov 25.2003 — 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....? ...
Copy linkTweet thisAlerts:
@tanfwcauthorNov 26.2003 — [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]


mi try later..ty
Copy linkTweet thisAlerts:
@tanfwcauthorNov 26.2003 — hmm...still cannot works...ty very much....anyone can help me ?
Copy linkTweet thisAlerts:
@tanfwcauthorDec 01.2003 — bump
×

Success!

Help @tanfwc spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...