Override constructor

Hi there…

Okay just quick shoot…here…ok just curiousity here…from my digging and reading I know that we can’t override constructor…but might possiblity can be achieve…so I really need some shed on light from expertise people or some ideas how to achieve it…here’s the my portions curiousity…



//let's say

class TestClass{
    var __a:String;
    var __b:Number

//==================constructor==============
    function TestClass(a:String){
       __a = a;
    }

    function TestClass(b:Number){
      __b = b;
    }
//==================constructor==============


}



//my curiosity is how to override constructor I mean give an options to me in order to to string params or numbers param2 either…


eg;

var test:TestClass = new TestClass("test");

var test:TestClass = new TestClass(2);

It is because my goal purposely wanna rectifying what of the datatype parameters being passing inside the class whether string or number…that’s all is it possible…???
Any help are really appreciated

Type the parameter as Object.

Thanks TheCanadian…I just check the type of parameter as u suggest it works ok now…tq mate…