Skip to main content
Participant
January 8, 2008
Question

Code behaves differently when run in debugger

  • January 8, 2008
  • 1 reply
  • 187 views
var he:Array = handControl.getHumanInfo(ha, handNumber);
while (he.length != 0)
{
humanInfo.push(he.shift());
}

This snippet is part of a large flash project I am working on. The program works fine by itself, but when I try to step through it in the debugger, it sometimes crashes, depending on where I put a breakpoint. If I put the breakpoint on the first line of code above, I can step into the function getHumanInfo(), trace it, and step back out, and everything is fine. But if I only put a breakpoint somewhere inside the getHumanInfo() function, all of a sudden when I step out of that function, the variable 'he' is undefined, and so the while loop never ends.

This makes no sense to me. The code is either good or bad, it shouldn't behave differently based on where I put the breakpoint.

The getHumanInfo() function always creates a new array and passes it back, so there is no reason 'he' should be undefined.

This has happened many times when I've tried to use the flash CS3 debugger -- is there a known issue that this sounds like? I'm so fed up I'm ready to stop using the debugger altogether.
This topic has been closed for replies.

1 reply

BillMcVeeAuthor
Participant
January 8, 2008
I ran the program without the debugger and put some trace() statements in, just to make sure. Everything works fine without the debugger. So it seems to me it has to be a debugger issue. Has anyone heard of a similar issue?