Trace not working in switch statement


(Lozza JP) #1

Just a quick one I can’t figure out I have a switch statement and this is one of the cases

			case 922:
				trace("test");
				eddy.toggleCamera(2);
				break;

The function is called and works but the trace never happens. Also if I put the trace in the toggleCamera function it doesn’t show either.

I have plenty of other debugging going on and trace calls happening else where so it is not the IDE settings or anything and yes I am running in debug not release mode.

The switch statement is called when a collision happens walking into an area if that helps at all.

Can anyone shed some light on this?


(Jacob Albano) #2

The first thing you should do is trace out the value that you’re switching on in the first place. It’s entirely possible that it never actually equals 922. There’s nothing about this code in particular that should be causing that problem.


(Lozza JP) #3

Putting a trace at the start of the function before the switch is called and that is never traced either. So I can’t see if I am indeed getting the value 922 put in.

Though I must be if the camera function is indeed being called?


(Lozza JP) #4

Oh god figured it out -_-

Flashdevelop had a backed up version open of the class I was editing. But since that switch 922 case existed in the current dir it was playing fine for the function.

Sorry to waste your time.