6 Replies Latest reply on Mar 16, 2011 8:00 AM by chriswillis100

    Calling functions

    chriswillis100

      Hey all,

       

      I have a function in a main mxml file and i would like to call it from a component.

      The main file is in a directory called views

       

      I have tried doing this in my component to call it:

       

       

      private function new_document():void {

      var clear:Function = playdrawhome.clear_func()

      clear.call();

      PopUpManager.removePopUp(this);

       

      }          

       

       

       

      </fx:Script>

       

      <fx:Declarations>

      <views:DocHome id="dochome" />

      </fx:Declarations>

       

       

       

      But adobe air gives me this error:

       

      Cannot access a property or method of a null object reference

       

       

      Can anyone help?

       

      Thanks

      Chris