Creating Anonymous Functions : Function variable : Function Flash / Flex / ActionScript examples


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

 

Creating Anonymous Functions


 

//Here is the syntax for an anonymous function:
/*
function():datatype {
  statements
};
*/

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

        var fSayHi:Function = function(sName:String):void {
          trace("Hi, " + sName);
        };
        fSayHi("Joey")

    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Function
» Function variable