Skip to main content
November 11, 2014
Question

What does this Error means :

  • November 11, 2014
  • 1 reply
  • 229 views

I am using XML to load the slider.as but when I click on the next button I get this Error , What does that mean?

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

at com::slider/fn_show_notice()

I am getting this Error when I am at case 9

I have the Function as below :

----------------------------------------


  private function fn_show_notice(IN_Event:MouseEvent):void
  {
   //trace("show notice");
  
   btn_showNotice.visible         = false;
  
   if(mc_notice != null)
   {
   
    return;
   
   }
  
   switch(int_counter)
   {
    case 9:
   
     mc_notice         = new com.popup1();
    
     mc_notice.txt_heading.text     = xml_popup.popup[0].heading;
    
     mc_notice.txt_data.htmlText    = xml_popup.popup[0].text;

     break;  
    
    
    case 13:
   
     mc_notice         = new com.popup1();
    
     mc_notice.txt_heading.text     = xml_popup.popup[1].heading;
    
     mc_notice.txt_data.htmlText    = xml_popup.popup[1].text;

     break;
    
    case 17:
   
     mc_notice         = new com.popup1();
    
     mc_notice.txt_heading.text     = xml_popup.popup[4].heading;
    
     mc_notice.txt_data.htmlText    = xml_popup.popup[4].text;

     break;  
    
    case 22:
   
     mc_notice         = new com.popup1();
    
     mc_notice.txt_heading.text     = xml_popup.popup[5].heading;
    
     mc_notice.txt_data.htmlText    = xml_popup.popup[5].text;

     break;  
    
    case 23:
   
     mc_notice         = new com.popup1();
    
     mc_notice.txt_heading.text     = xml_popup.popup[6].heading;
    
     mc_notice.txt_data.htmlText    = xml_popup.popup[6].text;

     break; 
    
    case 35:
   
     mc_notice         = new com.popup1();
    
     mc_notice.txt_heading.text     = xml_popup.popup[6].heading;
    
     mc_notice.txt_data.htmlText    = xml_popup.popup[6].text;

     break; 
    
    case 36:
   
     mc_notice         = new com.popup1();
    
     mc_notice.txt_heading.text     = xml_popup.popup[6].heading;
    
     mc_notice.txt_data.htmlText    = xml_popup.popup[6].text;

     break;      

   }

   mc_notice.x          = 44.95;
  
   mc_notice.y          = 69;

   addChild(mc_notice);
  }

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
November 11, 2014

The 1009 error indicates that one of the objects being targeted by your code is out of scope.  This could mean that the object....

 

- is declared but not instantiated

- doesn't have an instance name (or the instance name is mispelled)

- does not exist in the frame where that code is trying to talk to it

- is animated into place but is not assigned instance names in every keyframe for it

- is one of two or more consecutive keyframes of the same objects with no name assigned in the preceding frame(s).

 

If you go into your Publish Settings Flash section and select the option to Permit debugging, your error message should have a line number following the frame number which will help you isolate which object is involved.

November 11, 2014

PERFECT !! Thanks a lot for explaining in detail

Now since I know whats wrong here is another one I am not getting my hands on and I have no idea how to fix as I think when I run the flash File , it doesn't load XML atall and it says sandbox violation.

Here is the Error:

Error #2048: Security sandbox violationDesktop/Test%20Files/SimpleXML/xml/xml_data.xml halted

Can you please help me fix this ?