IceMetalPunk
01-10-2004, 03:46 PM
Hi,
I have a page, with all of this code EXACTLY as it is shown:
<title> </title>
<script>
letter=0;
next=0;
ud="+";
num=0;
message=new Array();
function AddMessages() {
if (isNaN(document.j.number.value*1) || document.j.number.value=="" || document.j.number.value==" ") { alert("Please type a NUMBER in the box."); return; }
document.getElementById("boxes").innerHTML="";
num=document.j.number.value*1;
for (i=0; i<num; i++) { document.getElementById("boxes").innerHTML+="<input type='text' name='message"+i+"'><br>"; }
}
function DoMessage() {
eval("letter"+ud+ud);
if (next>message.length-1) { next=0; }
if (letter>message[next].length) { ud="-"; }
if (letter<1) { ud="+"; next++; }
document.getElementById("type").innerHTML=message[next].substring(0, letter)+"_";
setTimeout("DoMessage()",100);
}
function DoIt() {
for (i=0; i<num; i++) { message[i]=eval("document.j.message"+i+".value"); }
}
</script><form name="j"><center><div id="boxes"><input type='text' name='message0'><br></div><br><input name="number" maxlength=2> <input type="button" value="Adjust Message Number" onClick="AddMessages()"> <input type="button" value="Make Message Typer!" onClick="next=0; letter=0; DoIt(); DoMessage()"><P><div id="type"></div>
It is made so that the user can enter as many messages as they want (up to 99) and it will "type" them and rotate them. The problem I'm having is that if they change a message and click "Make Message Typer!" again, it runs the script twice and speeds up. I have tried using a variable speed, and doubling that number each time the button is clicked, but that makes it jumpy. Anyone know how to fix this? Thanks in advance.
-IceMetalPunk (Kevin ;) )
P.S. The site is attatched as a .txt file in case it is too hard to read in this post.
I have a page, with all of this code EXACTLY as it is shown:
<title> </title>
<script>
letter=0;
next=0;
ud="+";
num=0;
message=new Array();
function AddMessages() {
if (isNaN(document.j.number.value*1) || document.j.number.value=="" || document.j.number.value==" ") { alert("Please type a NUMBER in the box."); return; }
document.getElementById("boxes").innerHTML="";
num=document.j.number.value*1;
for (i=0; i<num; i++) { document.getElementById("boxes").innerHTML+="<input type='text' name='message"+i+"'><br>"; }
}
function DoMessage() {
eval("letter"+ud+ud);
if (next>message.length-1) { next=0; }
if (letter>message[next].length) { ud="-"; }
if (letter<1) { ud="+"; next++; }
document.getElementById("type").innerHTML=message[next].substring(0, letter)+"_";
setTimeout("DoMessage()",100);
}
function DoIt() {
for (i=0; i<num; i++) { message[i]=eval("document.j.message"+i+".value"); }
}
</script><form name="j"><center><div id="boxes"><input type='text' name='message0'><br></div><br><input name="number" maxlength=2> <input type="button" value="Adjust Message Number" onClick="AddMessages()"> <input type="button" value="Make Message Typer!" onClick="next=0; letter=0; DoIt(); DoMessage()"><P><div id="type"></div>
It is made so that the user can enter as many messages as they want (up to 99) and it will "type" them and rotate them. The problem I'm having is that if they change a message and click "Make Message Typer!" again, it runs the script twice and speeds up. I have tried using a variable speed, and doubling that number each time the button is clicked, but that makes it jumpy. Anyone know how to fix this? Thanks in advance.
-IceMetalPunk (Kevin ;) )
P.S. The site is attatched as a .txt file in case it is too hard to read in this post.