Accessing variables form within a class

Hey… having trouble accessing variables from the main timeline from within my class…
this is a function within my class…(not the constructor function)


 public function createPanorama():void {
          var url:String = "../../../panorama/panoramaImg/fenway.jpg"; 
          var urlReq:URLRequest = new URLRequest(url);
          ldr1.x = 0; // we set our loader x position on screen
          ldr1.y = 0; // we set our loader y position on screen
          ldr1.load(urlReq); 
          ldr2.load(urlReq);
          ldr2.x = ldr1.width; 
          ldr2.y = ldr1.y; 
          panorama.addChild(ldr1);
          panorama.addChild(ldr2);

        if (autoStart) { addEventListener(Event.ENTER_FRAME, scrolling); } 
        else { removeEventListener(Event.ENTER_FRAME, scrolling);};       
    }

what i’m trying to do is set the variable url:String in my main timeline and have the class refer to it therefore making my class more generic and usefull… but when i set a variable in the main timeline and refer to it, i get this error…

1009Cannot access a property or method of a null object reference.

can anyone help to refer to it properly??