3 Replies Latest reply on May 7, 2009 11:35 AM by ntsiii

    Custom Component ...Null Object Reference

    DaSoccerBomb Level 1

      I am having a hard time understanding how to fix an issue i run accross in my flex application and i hope someone here can help me out! I am going to try and provide a very basic example that illustrates my problem...


      <!---Main.mxml ---->

      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"  layout="vertical" initialize="init()">



                     private function init():void {  

                         i have a call in here that connects to a clodfusion server through an remote object which returns a User object




      //Then i call a custom component that handles permissions for my application.  I pass the user object into this custom component

      <comp:Permissions user="{user}"/>




      <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()">



                     //this function basically goes off and gets some info that is dependent on the user loged in

                     private function init():void{






      So the problem is that my call in the main application takes a few seconds to run and since the customer componet is processed before all the use object is returned i get a "Null Object reference" error...  How can i make sure that the user object has been created and returned before it is used in  my custom components?


      Thank you