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);
}
}
Related examples in the same category