A simple example of a method declaration using parameters : Method : Class Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Class » Method »

 

A simple example of a method declaration using parameters


 

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

        var averageValue:Number = average(511);

    }
    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 Class
» Method