Constructor with parameter : Constructor : Class Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Class » Constructor »

 

Constructor with parameter


 

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

        
        var m:MultiplyNumbers = new MultiplyNumbers(2,3);

    }
  }
}

     class MultiplyNumbers {
          
          public function MultiplyNumbers(num1:Number,num2:Number):void {
               trace(num1*num2);
          }
          
     }

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Class
» Constructor