Flash Games

 FAQ   Search   Members   Groups   User Control Panel      Login 

It is currently Thu Jan 08, 2009 9:01 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Problem
PostPosted: Sun Oct 28, 2007 6:37 am 
Offline
1000+ Club

Joined: Thu May 31, 2007 4:28 pm
Posts: 1126
Location: Belfast, Northen Ireland
Hey I'm just changing a few things around in this hockey scorer thing so it't more like football for a friend but when you click the score button or the stop button the timer should stop until you click ok could someone have a look at the code and fix it for me please?
Code:
<SCRIPT LANGUAGE="JavaScript">

var homename = prompt ('type home team name below',' ');
var awayname = prompt ('type away team name below',' ');
var keepgoing=false

var up,down;var min1,sec1;var cmin1,csec1,cmin2,csec2;
function Minutes(data) {
for(var i=0;i<data.length;i++)
if(data.substring(i,i+1)==":")
break; 
return(data.substring(0,i));
}
function Seconds(data) {
for(var i=0;i<data.length;i++)
if(data.substring(i,i+1)==":")
break;
return(data.substring(i+1,data.length));
}
function Display(min,sec) {
var disp;
if(min<=9) disp=" 0";
else disp=" ";
disp+=min+":";
if(sec<=9) disp+="0"+sec;
else disp+=sec;
return(disp);
}
function Down() {
cmin2=1*Minutes(document.scoreboard.beg2.value);
csec2=0+Seconds(document.scoreboard.beg2.value);
DownRepeat();
}
function DownRepeat() {
csec2--;
if(csec2==-1) {
csec2=59; cmin2--;
}
document.scoreboard.disp2.value=Display(cmin2,csec2);
if((cmin2==0)&&(csec2==0))
alert("Countdown Stopped");
else down=setTimeout("DownRepeat()",1000);
}
// End -->
</SCRIPT>

<!-- STEP TWO: Copy this code into the BODY of your HTML document  -->

<BODY OnLoad="teamnames()" bgcolor="#000000">


<script language="javascript">

function scored() {
document.scoreboard.homescore.value += '+1';
}
function doit() {
var userinput = document.scoreboard.homescore.value;
document.scoreboard.homescore.value = eval (userinput);
}
function deduct() {
document.scoreboard.homescore.value += '-1';
}



function scored2() {
document.scoreboard.awayscore.value += '+1';
}
function doit2() {
var userinput = document.scoreboard.awayscore.value;
document.scoreboard.awayscore.value = eval (userinput);
}
function deduct2() {
document.scoreboard.awayscore.value += '-1';
}
function stop() {
alert("Timer has stopped; push OK to resume")
}
function teamnames() {
document.scoreboard.homename.value = homename;
document.scoreboard.awayname.value = awayname;
}
function teamnames2() {
document.scoreboard.marquee.value= 'homename' + 'vs' + 'awayname';
}
</script>


<form method="POST" action="--WEBBOT-SELF--" name="scoreboard">
<!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.txt"
    S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
<table border="5" width="100%" height="86" bordercolor="#000000">
<tr><td width="100%" colspan="4" align="center" height="30" bgcolor="#8196BA" bordercolor="#000000">Start at <input type="text" name="beg2" size="7" value="45:00">
<input type="text" name="disp2" size="7"> <input type="button" value="Start" onclick="Down()">
<input type="button" value="Stop" onclick="stop()"></td></tr>

<tr>
  <td width="34%" align="center" height="22" bgcolor="#8196BA" bordercolor="#000000"><b><font face="Abadi MT Condensed Extra Bold">First Half</font></b> <input type="radio" value="V3" checked name="R1"></td>
<td width="33%" colspan="2" align="center" height="22" bgcolor="#8196BA" bordercolor="#000000"><b><font face="Abadi MT Condensed Extra Bold">Second Half</font></b> <input type="radio" value="V1" name="R1"></td>
<td width="33%" align="center" height="22" bgcolor="#8196BA" bordercolor="#000000"><b><font face="Abadi MT Condensed Extra Bold">Extra Time</font></b> <input type="radio" value="V2" name="R1"></td></tr>

<tr><td width="50%" align="center" height="19" bordercolor="#000000" bgcolor="#FFDB48" colspan="2">
<p align="center"><input type="text" name="homename" size="20" display="homename" value="type home team here">
<input type="text" name="homescore" size="2" value="0"></p></td>
<td width="50%" align="center" height="19" bordercolor="#000000" bgcolor="#FFDB48" colspan="2"><p align="center"><input type="text" name="awayscore" size="2" value="0"><input type="text" name="awayname" size="20" value="type away name here"></p></td></tr>

<tr><td width="50%" align="center" height="19" bordercolor="#000000" bgcolor="#FFDB48" colspan="2"><input type="button" onclick="scored(); doit(); stop()" value="Scored" name="B1"></td>
<td width="50%" align="center" height="19" bordercolor="#000000" bgcolor="#FFDB48" colspan="2"><input type="button" onclick="scored2();doit2();stop()" value="Scored" name="B3"></td>
</tr>
</table>
</form>

_________________
Yummy Articles
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group - Flash Games - TNX Invitation Code - TNX Review

Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User:
Pass:
Log me on automatically each visit: