Referencing Functions : Function variable : Function Flash / Flex / ActionScript examples


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

 

Referencing Functions


 

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


        var fArea:Function = calculateArea;
        trace(fArea(66));
    }

    function calculateArea(a:Number, b:Number):Number {
      var nArea:Number = a * b;
      return nArea;
    }
  }
}
// 36

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Function
» Function variable