Speed in Applet

wxdqz

New Member
newbie to the forum.
I would like to control the speed of the water on an applet since it runs slower and faster depending on the chip speed for different computers. The problem is that I can only slow it down or speed it up only once. The script is called from an html page which in turn does a document.write to produce the same page but with a different speed. For the one time that I can use it it works great but I would like to use it more than once if needed. The following is a snipet of the code.

CODE..............

var speed = 0;

function reLoad(txt,frm)
{
speed = frm.frmSpeed.value;

if(txt == "A")
{
speed += 10;
}
else
{
speed -= 10;
}

output("ouput stuff goes here");

output+="<form name='waves'>";
output+="<input type='button' value='http://www.webdeveloper.com/forum/archive/index.php/Slow down Waves' onClick='reLoad('B', this.form)'>";
output+="<input type='button' value='http://www.webdeveloper.com/forum/archive/index.php/Speed up Waves' onClick='reLoad('A', this.form)'>";
output+="<INPUT type='hidden' name='frmSpeed' value=http://www.webdeveloper.com/forum/archive/index.php/" + speed +">";
output+="</form><Body><HTML>";


document.write(output);

The hidden field is used to pass the current speed to the script.

Thanks
 
Back
Top