View Single Post
Old 03-10-2005, 01:06 AM   #1 (permalink)
CityOfAngels
Oh shit it's Wayne Brady!
 
CityOfAngels's Avatar
 
Location: Passenger seat of Wayne Brady's car.
[Javascript/HTML] Random Music Player

Hi. I'd like to know how to program a random music player that would work on any standard web browser. Here is the code I have so far:
Code:
<html>
<body>

<h2>NAME OF SONG</h2>

<object
height="50%"
width="50%"
classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
<param name="AutoStart" value="0" />
<param name="FileName" value="URLtoSONG.wav" />
</object>

</body>
</html>
Now this is just basic HTML. I assume I need a Javascript, so this is what I need it to do:
1) I need it to work similar to the standard HTML code above as far as how user-friendly it is and how it is displayed.
2) I need either a random or sequential number within a range to be selected every time an external button (placed under the display, saying "Click here to change the song!") is clicked.
3) I need an "if" clause that aligns that range of numbers with URLs to different songs (which I will provide later), and then assigns them to the "FileName" value in the code above.
4) I also need the range of numbers to be assigned to the names of the songs, which will display in a label above the display.
5) If at all possible, it would also be cool if there can be a checkbox stuck next to the display that says "Autoplay?", and when checked, it would assign "AutoStart" value to "1", and when unchecked, it would assign that same value to "0".

Can anyone help me out with this? I've been wondering how to do this for quite some time. I've accomplished it in Visual Basic, but I have absolutely no experience with Javascript, and I haven't done any Visual Basic work at all for over 2 years.
__________________
The words "love" and "life" go together. It is almost as if they are one. You must love to live, and you must live to love, or you have never lived nor loved at all.

Quote:
Originally Posted by Zeraph
...the best way to keep a big secret would be to make it public with disinformation...
CityOfAngels is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46