PDA

View Full Version : Midi Jukebox


Lee
06-22-2001, 10:31 AM
Hi All,

I have found A1Javascipts to be very helpful in allowing people to use their Scripts for free.
My Problem...
I have all my midi files in a folder named "sounds" and i have linked my songs from the Jukebox to there,the problem is that when i click on a song to play it takes me to the contents of my "sounds" folder instead of playing the song.
I am sure the solution is simple i have tried 1. http://creative-lee/sounds/midi1.mid
2. /sounds/midi1.mid
3. sounds/midi1.mid
but alas i have had no luck.
This is one of the links from my site:

group[0][0]=new Option("2001","sounds/2001.mid")

Anyone have any ideas what i am doing wrong.
Your Help will be greatly appreciated.

Regards Lee

whkoh
06-22-2001, 10:46 AM
First welcome to htmlforums.

Second, if you were to post the source code, we'll check it for you.

Lee
06-22-2001, 02:24 PM
Thankyou for taking the time to check the code for this script.


<!-- --><form name="midijukebox">
<center><table BORDER=0 CELLSPACING=0 CELLPADDING=0 COLS=1 WIDTH="210">
<tr>
<td ALIGN=CENTER VALIGN=TOP>
<center><table BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
<tr>
<td ALIGN=RIGHT VALIGN=TOP WIDTH="20"><img src="/images/leftcorner.gif" width="20" height="20"></td>
<td ALIGN=CENTER VALIGN=CENTER WIDTH="170"><img src="/images/middlecat.gif" width="170" height="20" alt="Select A Category"></td>
<td ALIGN=LEFT VALIGN=TOP WIDTH="20"><img src="/images/rightcorner.gif" width="20" height="20"></td>
</tr>
</table></center>
<center><table BORDER=1 CELLSPACING=1 CELLPADDING=1 COLS=3 WIDTH="100%" BACKGROUND="/images/sharp006.gif">
<tr>
<td ALIGN=CENTER VALIGN=TOP WIDTH="35"><img SRC="/images/speakleft3.gif" height=60 width=45 alt="Left Speaker"></td>
<td ALIGN=CENTER VALIGN=CENTER BACKGROUND="/images/212.jpg"><select name="example" size="3.5" style="width:100" width="100px" border="0" onChange="redirect(this.options.selectedIndex)"><font size=-2><option>Favourites</option><option>Classical</option></font></select></td>
<td ALIGN=RIGHT VALIGN=TOP WIDTH="35"><img SRC="/images/speakright3.gif" height=60 width=45 alt="Right Speaker"></td>
</tr>
</table></center>
</td>
</tr>
<tr>
<td ALIGN=CENTER VALIGN=BOTTOM BACKGROUND="/images/sharp006.gif">
<center><table BORDER CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
<tr>
<td ALIGN=LEFT VALIGN=TOP WIDTH="10%"></td>
<td ALIGN=CENTER VALIGN=TOP WIDTH="170"><img src="/images/middletitle.gif" width="170" height="19" alt="Song Title"></td>
<td WIDTH="10%"></td>
</tr>
<tr ALIGN=CENTER VALIGN=CENTER>
<td ALIGN=LEFT WIDTH="10%"></td>
<td ALIGN=CENTER VALIGN=CENTER WIDTH="80%"><select name="stage2" size="4" style="width:140" width="140px" border color="#000000"><option value=""></option></select></td>
<td WIDTH="10%"></td>
</tr>
<tr ALIGN=CENTER VALIGN=TOP>
<td ALIGN=LEFT WIDTH="10%"></td>
<td ALIGN=CENTER VALIGN=TOP WIDTH="72%"><img src="/images/leftbar1.gif" width="40" height="16" alt="left bar"><!--A1 --><input type="button" name="test" value="Play Me!"
onClick="go();window.focus()"><!-- --><img src="/images/rightbar1.gif" width="40" height="16" alt="right bar"></td>
<td ALIGN=LEFT WIDTH="10%"></td>
</tr>
</table></center>
</td>
</tr>
</table></center>
<center><script>
<!--
/*
Midi Jukebox Script
Copyright¿1999 All right reserved- from A1 JavaScripts. http://www.a1javascripts.com/
it may be used freely but Please leave this credit in at all times
This script is for personal use and can not be exhibited or downloaded from any other archive without permission
*/
var groups=document.midijukebox.example.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()
group[0][0]=new Option("2001","sounds/2001.mid")
group[0][1]=new Option("Funky Town","sounds/funky town.mid")
group[0][2]=new Option("We Are Family","sounds/we are family.mid")
group[0][3]=new Option("Caribbean Blue","sounds/caribbean blue.mid")
group[0][4]=new Option("Slim Shady","sounds/slimshady.mid")
group[1][0]=new Option("Four Seasons","sounds/4seasons.mid")
group[1][1]=new Option("Air On A G-String","sounds/bach gstring.mid")
group[1][2]=new Option("Beethoven","sounds/beethoven.mid")
var temp=document.midijukebox.stage2
function redirect(x){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<group[x].length;i++){
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
}
temp.options[0].selected=true
}
function go(){
location=temp.options[temp.selectedIndex].value
}
//-->
</script></center></form>
<!-- -->




Much Obliged Lee

Mark
06-22-2001, 03:38 PM
Try putting th full URL's instead of the other ones

Instead of:

group[0][0]=new Option("2001","sounds/2001.mid")
group[0][1]=new Option("Funky Town","sounds/funky town.mid")

Use this:

group[0][0]=new Option("2001","http://www.yoururl.com/sounds/2001.mid")
group[0][1]=new Option("Funky Town","http://www.yoururl.com/sounds/funky town.mid")


a1javascripts.com did the same thing, and since thiers work, your's should too!

Dr. Web
06-22-2001, 04:27 PM
good call mark,
when in doubt use fully qualified urls!

Mark
06-22-2001, 04:41 PM
Originally posted by Dr. Web
good call mark,
when in doubt use fully qualified urls! unless when you move your site..then that would cause a problem

Dr. Web
06-22-2001, 06:34 PM
well we are talking about getting a script running....

if you move your site, your going to have to keep an eye on everything. Plus after you get the absolute URL working, you can cut it down to a relative URL.