1 Reply Latest reply on Jan 3, 2011 8:52 AM by Gregory Lafrance

    Cannot access a property or method of a null object reference coming for First Time

    kiran7881 Level 1

      Hi ,


      I have Four Components , Two textInputs and two Date Fields .
      Where My requirement is to display enetred TextInputs in one Line and display DateFileds selected in a Another line on to a Text Area.






        <mx:Canvas label="Datebase Search" toolTip="Datebase Search">

          <mx:TextInput id="FromTI" x="85" width="373" change="enterContext()" />
          <mx:TextInput id="ToTI" x="85" y="33" width="100%" change="enterContext()" />

          <mx:DateField id="AfterDF" x="80" y="17"/>
          <mx:DateField id="toDF" x="80" y="56"/>




      I tried this way :


      Application.application.myTA.text = FromTI.text+" "+ToTI.text +"\n"+AfterDF.text+" "+toDF.text;


      The Problem is taht , I am getting this Error , whenever  I entered something on to the TextField FromTI (This is only coming for the First Time )


      Could anybody please help me , Thanks .

        • 1. Re: Cannot access a property or method of a null object reference coming for First Time
          Gregory Lafrance Level 6

          As a first step, I would do the following, to see which is null:


          if(Application.application.myTA == null){



          if(FromTI == null){



          if(Application.application.myTA == null){



          if(Application.application.myTA == null){



          if(Application.application.myTA == null){




          However, if any of these referenced components are in the non-first view of a ViewStack, Accordion, or TabBar, and that navigator container does not have creationPolicy="all", then this will likely occur.


          If this post answers your question or helps, please mark it as such. Thanks!

          Adobe Flex Development and Support Services