Function type variable : Function variable : Function Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Function » Function variable »

 

Function type variable


 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){

      var fFactorial:Function  = function(nOperand:Number):Number{
              if(nOperand > 0){
                return nOperand * arguments.callee(nOperand-1);
              }
              else{
                return 1;
              }
      }

      fFactorial(2);
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Function
» Function variable