12 Replies Latest reply on Nov 4, 2009 1:30 AM by ana.valente

    Error #1009: Cannot access a property or method of a null object reference

    ana.valente

      Hi there,

       

      well i have a problem with my analog clock... i have it in my homepage and now it's working fine, but when i test my movie and click in my portfolio, for example, my output windows gives me this error:

       

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
          at index_fla::MainTimeline/clock()

       

      i don't understand because even when i change from page to page (or frames) the clock is still working and everything is ok... but the message keeps appearing till i close my test movie window... and i've noticed that when i go online, there are some files missing that weren't till i had the clock on my homepage...

       

      my code for the clock is:

       


      function clock (evt:Event):void {
           var time:Date = new Date();
           var mil = time.getMilliseconds();
           var s = time.getSeconds();
           var m = time.getMinutes();
           var h = time.getHours();
          
           seconds.rotation = s*6+(mil/(1000/6));
           minutes.rotation = m*6+(s/10);
           hours.rotation = h*30+(m/2);
      }

       

      stage.addEventListener(Event.ENTER_FRAME, clock);

       

       

      can anyone help me please??

       

      thanks