I'm new to AS3 and I'm getting this error while trying to implement OO style code.
Incorrect number of arguments. Expected no more than 0.
When I try to:
var countries:Country = new Country(10);
Normally this would work in Java or C++, so I'm not sure what's up!?
Here is my custom class.
package {
public class Country {
var cName:String = "noName";
public function Country() {
// constructor code
}
public function setName(n:String):void {
cName = n;
}
public function getName():String {
return cName;
}
}
}
var countries:Vector.<Country> = new Vector.<Country>(10,true);public function set name(n:String):void{cName = n} public function get name():String{return cName;}//then with an instance: country.name = "A";//setter trace(country.name);//getteralthough, using java style like what you now is a bit faster I think.new Country(10)' is not array nor in C++, nor in Java !!