Return value from function : Return : Function Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Function » Return »

 

Return value from function


 
package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        trace(getCircumference(25))// Displays: 78.53981633974483


    }
    function getCircumference (diameter:Number):Number {
        var circumference:Number = diameter * Math.PI;
        return circumference;
    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Function
» Return