A method assigned to a variable can be invoked via that variable using the standard parentheses operator, ( ). : Function variable : Function Flash / Flex / ActionScript examples


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

 

A method assigned to a variable can be invoked via that variable using the standard parentheses operator, ( ).


 

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

    var consume = eat;
    consume();


    }
    public function eat () {
      trace("eat");
    }    
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Function
» Function variable