i would simply like to encapsulate a function in it's own .as file, but i can't quite get it.
package
{
public class NumberAdd
{
public function NumberAdd()
{
public static function myNumber(val:Number):Number
{
return val + 2;
}
}
}
}
this i would call it like this:
var myNum:Number = NumberAdd.myNumber(2);
trace(myNum); //traces 4
what is my mistake?