6 Replies Latest reply on Jul 21, 2011 3:59 PM by chriswillis100

    Running code from another function

    chriswillis100

      Hey guys,

       

      If i've got a lot of code in a function:

       

      protected function mouseDown(event:MouseEvent):void {

       

      .... lots of code

       

      }

       

       

       

      When i try and run the code from another function:

       

      protected function mouseDown(event:MouseEvent):void {

       

      code();

       

      }

       

      protected function code(event:MouseEvent):void {

       

      .... lots of code

       

      }

       

       

      I get an error where the code() is saying that it's expecting 1 argument, i guess because i've declared event:MouseEvent, but i need that

      What parameter do i put it?

       

      I

      Thanks

      Chris