View Full Version : Out of Memory error

07-11-2004, 04:52 PM
LOOK @ SCRIPT FIRST, so paragraph can be more easily understood

I have a script that, when I try to run it, works a for a about a millisecond, doing many times the math that the script requires (+=275), and then gives me an alert saying OUT OF MEMORY AT LINE 44. Notepad says line 44 is the line w/ the getElementById("~") thing. I think I've made a loop (that made the browser run out of memory, the scripts proccesses to run super fast[which caused the crash because there was no limiter on the script]) before the setTimeout but I don't see where/how.

function turny() {
var XWERT=document.getElementById("RNDRCTY").style;
//Note:later add if(>360) {to0dg}
var Timer=setTimeout(turny(),1103)
function Stoyp() {

<v:roundrect... onMousedown="turny()" onMouseup="Stoyp()" ...>...

Willy Duitt
07-11-2004, 04:57 PM
You need to move your conditional which limits the highend of the increments to above: XWERT.rotation+=5;

07-12-2004, 08:30 AM
And you're clearing a local variable Timer not global. Remove the var keyword in

var Timer=setTimeout(turny(),1103)

to make the Timer variable global. Or for good practice, declare Timer with var keyword outside the function.

var Timer;
function turny(){
Timer = ...
function Stoyp() {

07-12-2004, 04:50 PM
SUCCESS!! Thanks a lot!