How to solve TypeError: Error #1009

I’m new to Flash CS3 and actionscript 3. I have created a preloader for a panorama that was built using actionscript 3. The panorama by itself works fine but once loaded by the preloader it throws this error

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Panorama/setBounds()
at Panorama/frame1()

any help would be greatly appreciated.