title: Error 1009, it is impossible to access the property or method of a null object reference
body: <p>I have the following action script class and when I instantiate the class by calling the constructor in a mxml file I have get "error 1009 it is impossible to access the property or method of a null object reference". Why do I receive this error?</p>
  
  <pre><code>package com.esprit.immocr.DTO
  {
     import mx.collections.ArrayCollection;   
     [Bindable]
     [RemoteClass(alias="com.esprit.immocr.DTO.TypePieceDto")]
     public class Typ 
     {
         public var code_type_piec:  String;
         public var Libelle_t_piec: String;
         //Association
         public var clientsdto: ArrayCollection;
         public function Typ(o:Object):void
         {
              this.code_type_piec = o.code_type_piec;
              this.Libelle_t_piec = o.Libelle_t_piec;
              this.clientsdto = o.clientsdto;
         }    
      }
  }
  </code></pre>
  
  <p>and the following mxml file using this class</p>
  
  <pre><code>protected function tpvalider(event:MouseEvent):void
  {
      //ro.removeEventListener(Event.ADDED_TO_STAGE, tpvalider);
      tp.code_type_piec=codetp.text;
      tp.Libelle_t_piec=libtp.text;
      ro.createTppiece(tp); // ro is a reference to remote object 
  }
  private  var tp: Typ = new Typ(obj);
  </code></pre>