Test movie works, but not publish movie

I’ve run into this strange problem. When testing my game in flash cs3, everything works perfectly. But, when i publish the movie, i get a “TypeError: Error #1009: Cannot access a property or method of a null object reference.” I never got this error when testing my movie. vEven, running the swf created when i test the movie gives me this error.

I’ve narrowed down the reason for it and its because of variables I declared but didn’t initialize(or is it initialize but didn’t declare?). But why does it work when testing my movie in flash, but not by running the swf file? I’m stumped! Any help would be great!