Obtaining the Result of a Method : Return : Function Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Function » Return »

 

Obtaining the Result of a Method


 

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

        var playerScore:Number = average(610);
        trace("The player's average score is " + playerScore);


    }
    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