Use the return value of a method, without storing it in a variable, by passing it as a parameter to another function : Return : Function Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Function » Return »

 

Use the return value of a method, without storing it in a variable, by passing it as a parameter to another function


 


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


        trace("The player's average score is " + average(610));


    }
    private function average (a:Number, b:Number):Number {
      return (a + b)/2;
    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Function
» Return