loadLevel() function not working, VERY weird

THE PROBLEM HAS BEEN FIXED!

Ok, so a few of you probably know Im working on a little double dragon style engine, you can view it in the showcase forum.

Anyway, everything was going great until 5 minutes ago when the movie just started being completely messed up. My loadLevel() function was working fine, but now is not being called when it is meant to. HOWEVER, once I rightclick and press play, it loads!!!?! Let me explain a little.

My main timeline is 2 frames, 1 frame for the preloader and 1 frame to load the game in, Frame 1 and Frame 2; basic stuff. The preloader loads the content, and then switches to frame 2 where loadLevel() lies at the bottom of all the script. (yes, im not using classes, please don’t tell me to)

Like I said, it was working up until 5 minutes ago, I renamed it and saved it with a little bit of new script to spawn in another movieclip. I’ve since removed the code, but the problem still remains.

Frame 1, load the content, Frame 2 is where the game loads, but now just shows a blank screen. If you right click and press play, the level will load and everything will be fine. The loadLevel script is ON frame 2 at the bottom, but will not load until you right click and play.

SO! there has to be some point in the script where the movie will stop running code, right? Wrong. I placed a trace directly beneath the loadLevel and it traced fine. It just seems to be this function. Is the loadLevel function too large (over 100 lines)? I have most things broken in to multiple functions that span about 10-20 lines each

Also, if I place the loadLevel() 1 line directly AFTER the function itself, it will make the function work and load the level… but it will repeat the function every frame, even though I do not have it anywhere near an onEnterFrame handler… sigh

Please help, I was having a lot of fun working on this game, I don’t want to have to backtrack 6 hours of work. It was all fine tuning and crap, stuff I don’t really want to do again.

Cheers