3 Replies Latest reply on Aug 3, 2009 3:42 AM by kris456

    Accessing a button in a Component from other component

    kris456

      I have a two components Test_Interface.mxml & teacher_fullscreen. I called teacher_fullscreen.mxml from Test_Interface.mxml by

       

                    private var tfull:teacher_fullscreen = new teacher_fullscreen();
                    tfull.title = "Teacher Window";             
                    tfull.maximizable=true;              
                    tfull.systemChrome = 'none';
                    tfull.minWidth = 800;
                    tfull.minHeight = 600;              
                    tfull.open();               
                    
      

      Now I created an instance of Test_interface in my 2nd mxml by

       

      public var par:Test_Interface=new Test_Interface();
      

       

      Actually, I wanted to disable a button in Test_interaface.mxml with id = "b1" from my 2nd mxml using the object created above.

      So I gave par.b1.enabled=false; It did not give any compile errors but during run time cannot access object or method of null reference sandbox error was returned for the statement par.b1.enabled=false. So how do I change the property of a button in one component from other. Please Help me.