Hi all:I am needing help with an error message and a result to get around it.
The code I have is this:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled</title>
<script language="javascript">
<!--
var ball = document.getElementById("ball1");
var xposR2L = 100;
var xposL2R = -100;
var timer = setInterval("start()",1);
function start()
{
goLeft();
}
function goLeft()
{
xposR2L+=3;
ball1.style.right = xposR2L + "px";
if(xposR2L>=1100)
{
goRight();
}
}
function goRight()
{
xposL2R+=3;
ball1.style.left = xposL2R + "px";
if(xposL2R>=1000)
{
goLeft();
}
}
function stop()
{
clearInterval(timer);
}
//-->
</script>
</head>
<body onload="start()">
<div id="numb"></div>
<div id="ball1" style="position:absolute;right:0">
<img src="file:///C|/Users/Owner/Documents/ball1.gif" width="30"
height="30" vspace="120" hspace="100" border="0" />
</div>
</body>
</html>
When I run it, the ball goes to the left Ok and then back to the starting point, then this merror message appears,"Out of Memmory".
Can anyone tell me if the stack pointer or something like that needs to be reset after the loop is finnished or is there another loop format that can be used where the 'Out of Memmory" error will not appear and stop the program?
I have attached the ball along with this code.
Any help will be appreciated.
Thanks all for the help and info.
Michael
This post has been edited by gm5660: 17 January 2011 - 10:22 PM

New Topic/Question
This topic is locked



MultiQuote




|