Thread: Midi Script
Results 1 to 14 of 14
Related
-
is there a difference between <script language="javascript> and <script type="text/javascript"> Forum: Javascript Forum
Replies: 8 -
Help with Random Content script (need hotlink in script) Forum: Javascript Forum
Replies: 0 -
What a good midi site? Forum: General Discussion
Replies: 10 -
I need some help with Midi's Forum: Website Scripts Forum
Replies: 1
-
03-11-2001, 05:18 PM #1
Midi Script
I found a midi script for my website. And I am trying to add a stop button to it. I think I have gotten the button added right but figuring out how to add the function I want is a little more difficult. All I want it to do is stop the music from playing. I am pretty sure I add the string in the same area with the other functions but what do I add. Here is the script.
<Script Language="JavaScript">
<!-- Hiding
/* Script by Lefteris Haritou :
http://www.geocities.com/~lef
Please keep the above credit.
No copyrights but be fair.
*/
song = new Array()
var x = 0
song[1] = "Creed-Higher"
function prev(){
if (x>1)
{ x--
document.midi.typein.value=song [x]
}
}
function next(){
var max= song.length-1
if (x<max)
{ x++
document.midi.typein.value=song [x]
}
}
function go(){
if (x != 0){
location.href='song'+x+'.mid'
}
}
function start(){
x=1
document.midi.typein.value=song [x]
}
function end(){
x=song.length-1
document.midi.typein.value=song [x]
}
function cls(){
document.midi.typein.value="Select Midi Song"
}
// Done Hiding -->
</Script>
<BODY Bgcolor="#000000" TEXT="#ff0000" LINK="#0000ff" VLINK="#00ffff" onload="cls()">
<!--#framecode-->
<P ALIGN=Center>
<sub><b>Some Music if you like </b></sub>
<IMG SRC="fireball.gif" WIDTH="71" HEIGHT="100" ALT="Fire" BORDER="0" ALIGN="left">
<IMG SRC="fireball.gif" WIDTH="71" HEIGHT="100" ALT="Fire" BORDER="0" ALIGN="right">
<Center>
<FORM Name="midi">
<INPUT NAME="typein" TYPE="text" SIZE="25" ALIGN=top><BR>
<font size=3 face="Comic Sans Ms">
<INPUT TYPE=Button Value="|<<" Align=left onclick="start()">
<INPUT TYPE=Button Value="<<" Align=left onclick="prev()">
<INPUT TYPE=Button Value="PLAY" Align=left onclick="go()">
<INPUT TYPE=Button Value=">>" Align=left onclick="next()">
<INPUT TYPE=Button Value=">>|" Align=left onclick="end()">
<P ALIGN=Center>
<INPUT TYPE=Button Value="STOP" Align=left onclick="stop()">
</FORM></font></CENTER>
------------------
ShadowLast edited by HTML; 10-10-2003 at 08:39 AM.
-
03-11-2001, 07:03 PM #2
Well don't ask me. Javascript isn't exactly my thing yet
So what are you trying to do? Stop the song? Stop it when. Some kind of timed script?
Last edited by HTML; 10-10-2003 at 08:39 AM.
-
03-11-2001, 07:21 PM #3
I guess it would have helped to mention that. I want users to be able to stop it when they press the Stop button.
------------------
Shadow
-
03-11-2001, 07:27 PM #4
why not just embed the midi with a smallconsole set, then they can stop it when they want to, without fancy javascript.
------------------
Allyn -
-
03-11-2001, 11:20 PM #5
Can you do that and have a selection of about 20 or 30 midis. Right now I have 10 I just cut them out of the script there so they dont waste anymore space on the forum.
Also on another point so I dont have to start a new topic. I put a new menu on my site but there is one prob with it. When I go to my forum which is hosted by EZ-boards the links in the left frame dont work anymore but if I go back to a page hosted by spaceports they work. I know its a prob with the script cause an HTML link will work fine. Can you check it out anyone who might be able to help. Just go to my page http://keepersofvictory.cjb.net and click the forum link in the left frame then try to go back to the main page or something you will see what I mean.
------------------
Shadow
-
03-12-2001, 02:18 AM #6
<p><script language="javascript">
// use this script freely
// var nummidi stands for the number of midis given
var nummidi = 10
day = new Date()
seed = day.getTime()
ran = parseInt(((seed - (parseInt(seed/1000,10) * 1000))/10)/100*nummidi
+ 1,10)
if (ran == (10))
midi=("10.mid")
if (ran == (9))
midi=("9.mid")
if (ran == (8))
midi=("8.mid")
if (ran == (7))
midi=("7.mid")
if (ran == (6))
midi=("6.mid")
if (ran == (5))
midi=("5.mid")
if (ran == (4))
midi=("4.mid")
if (ran == (3))
midi=("3.mid")
if (ran == (2))
midi=("2.mid")
if (ran == (1))
midi=("1.mid")
document.write('<EMBED SRC= "' + midi + '" CONTROLS=smallconsole HEIGHT=15 WIDTH=50 AUTOSTART=TRUE HIDDEN=FALSE LOOP=TRUE VOLUME=100%>')
document.write('<BGSOUND SRC= ' + midi + ' AUTOSTART=TRUE LOOP=TRUE>')
</script>
<br>
<form>
<INPUT TYPE="button" NAME="BUTTON" VALUE="Reload" onclick="location.reload();">
</form>
I used this for about 1 1/2 years, so it should work.
------------------
Allyn -
-
03-12-2001, 12:35 PM #7
Ok great I will try this out. Thanx.
Also Im still having the above problem with my menu I still cant figure out what the problem is.
------------------
Shadow
-
03-12-2001, 03:49 PM #8
I get js erros on the menu (decription is not defined) I am using ie4.*
-
03-12-2001, 05:17 PM #9
Dave, Do you know of some kind of freeware or shareware program I can use to debug javascripts? Or can I post the script here and see if you can spot the prob?
------------------
Shadow
-
03-12-2001, 07:30 PM #10
Regardless of the impression you may have, I have never spent more than 2 minutes looking at any type of javascript tutorial.
Post the script, I am sure one of our wonderful members will be able to figure it out.
Dave
-
03-13-2001, 12:28 AM #11
Ok here is the script. Part 1 is the head tag part and 2 is the body part.
1.
<style type="text/css">
<!--
.menu {font-family:Verdana; font-size:8pt; font-weight:bold}
-->
</style>
<script language="javascript">
<!--
function movein(which,html){
which.style.background='#00FF00'
description.innerHTML=html
}
function moveout(which){
which.style.background='black'
description.innerHTML=' '
}
-->
</script>
2.
<table bgcolor="black" border="1" bordercolor="ivory" cellpadding="2" cellspacing="0">
<tr>
<td cl***="menu" bordercolor="black" id="choice1" style="background-color:black; cursor:hand" onmouseover="movein(choice1,'Home')" onmouseout="moveout(choice1)" onclick="top.main.location.href='main.html'">
Home</td></tr>
<td cl***="menu" bordercolor="black" id="choice2" style="background-color:black; cursor:hand" onmouseover="movein(choice2,'Members!')" onmouseout="moveout(choice2)" onclick="top.main.location.href='members.html'">
Members</td></tr>
<td cl***="menu" bordercolor="black" id="choice3" style="background-color:black; cursor:hand" onmouseover="movein(choice3,'Members Only!')" onmouseout="moveout(choice3)" onclick="top.main.location.href='members/only/members1234567890.html'">Members Only</td></tr>
<td cl***="menu" bordercolor="black" id="choice4" style="background-color:black; cursor:hand" onmouseover="movein(choice4,'Forums!')" onmouseout="moveout(choice4)" onclick="top.main.location.href='http://pub51.ezboard.com/bkeepersofvictory'">Forums</td></tr>
<td cl***="menu" bordercolor="black" id="choice5" style="background-color:black; cursor:hand" onmouseover="movein(choice5,'See about joining us!')" onmouseout="moveout(choice5)" onclick="top.main.location.href='joinus.html'">Join Us</td></tr>
<td cl***="menu" bordercolor="black" id="choice6" style="background-color:black; cursor:hand" onmouseover="movein(choice6,'Trainers!')" onmouseout="moveout(choice6)" onclick="top.main.location.href='trainers.html'">Trainers</td></tr>
<td cl***="menu" bordercolor="black" id="choice7" style="background-color:black; cursor:hand" onmouseover="movein(choice7,'Cheats!')" onmouseout="moveout(choice7)" onclick="top.main.location.href='cheats.html'">Cheats</td></tr>
<td cl***="menu" bordercolor="black" id="choice8" style="background-color:black; cursor:hand" onmouseover="movein(choice8,'Editors!')" onmouseout="moveout(choice8)" onclick="top.main.location.href='editors.html'">Editors(N/A)</td></tr>
<td cl***="menu" bordercolor="black" id="choice9" style="background-color:black; cursor:hand" onmouseover="movein(choice9,'Tutorials!')" onmouseout="moveout(choice9)" onclick="top.main.location.href='tutorials.html'">Tutorials(N/A)</td></tr>
<td cl***="menu" bordercolor="black" id="choice10" style="background-color:black; cursor:hand" onmouseover="movein(choice10,'Tools!')" onmouseout="moveout(choice10)" onclick="top.main.location.href='tools.html'">Tools</td></tr>
<td cl***="menu" bordercolor="black" id="choice11" style="background-color:black; cursor:hand" onmouseover="movein(choice11,'Misc. Programs!')" onmouseout="moveout(choice11)" onclick="top.main.location.href='miscprograms.html'">Misc. Programs(N/A)</td></tr>
<td cl***="menu" bordercolor="black" id="choice12" style="background-color:black; cursor:hand" onmouseover="movein(choice12,'FFA links!')" onmouseout="moveout(choice12)" onclick="top.main.location.href='http://members.sitegadgets.com/keepers/links.html'">Links</td></tr>
<td cl***="menu" bordercolor="black" id="choice13" style="background-color:black; cursor:hand" onmouseover="movein(choice13,'Vote in our Poll!')" onmouseout="moveout(choice13)" onclick="top.main.location.href='http://members.sitegadgets.com/scripts/vote.cgi?username=keepers'">Vote</td></tr>
<td cl***="menu" bordercolor="black" id="choice14" style="background-color:black; cursor:hand" onmouseover="movein(choice14,'See our pole Results!')" onmouseout="moveout(choice14)" onclick="top.main.location.href='http://members.sitegadgets.com/scripts/vote.cgi?username=keepers&show=1'">Results</td></tr>
<td cl***="menu" bordercolor="black" id="choice15" style="background-color:black; cursor:hand" onmouseover="movein(choice15,'Comments or Bugs!')" onmouseout="moveout(choice15)" onclick="top.main.location.href='comment.html'">Comments or Bugs</td></tr>
<td cl***="menu" bordercolor="black" id="choice16" style="background-color:black; cursor:hand" onmouseover="movein(choice16,'Sign our guestbook!')" onmouseout="moveout(choice16)" onclick="top.main.location.href='http://members.sitegadgets.com/keepers/signbook.html'">Sign Book</td></tr>
<td cl***="menu" bordercolor="black" id="choice17" style="background-color:black; cursor:hand" onmouseover="movein(choice17,'View our Guestbook!')" onmouseout="moveout(choice17)" onclick="top.main.location.href='http://members.sitegadgets.com/keepers/guestbook.html'">View Book</td></tr>
<td cl***="menu" bordercolor="black" id="choice18" style="background-color:black; cursor:hand" onmouseover="movein(choice18,'About KoV!')" onmouseout="moveout(choice18)" onclick="top.main.location.href='aboutus.html'">About Us</td></tr>
<td cl***="menu" bordercolor="black" id="choice19" style="background-color:black; cursor:hand" onmouseover="movein(choice19,'How to Contact us!')" onmouseout="moveout(choice19)" onclick="top.main.location.href='contactus.html'">contact Us</td></tr>
</table>
------------------
Shadow
-
03-13-2001, 02:17 AM #12
Re: Menus
Works fine for me..
(shrugs)
------------------
QuietDean-
-
03-15-2001, 09:42 PM #13
It works for me fine, but if all doesn't work out you could always use another one of the million and one rollover scripts out there
Last edited by HTML; 03-09-2012 at 09:15 AM.
-
03-16-2001, 12:34 PM #14
Well until I decide what to do or what to use I have set up a non-Javascript menu people can use if that one gives them probs. It may not be a problem with the code maybe only with specific browsers.
------------------
Shadow
Cloudjiffy- PaaS for Developers
10-05-2020, 12:30 AM in Web Hosting Forum