Class with static function-like constructor

Hey!

I’m currently writing a class where I’d like to call the class constructor without having to instantiate the class itself. Something like this :

Class:


package
{
    public class ClassName
    {
        public function ClassName(text:String):String
        {
            text = text + " test123";
            return text;
        }
    }
}

Usage:


import ClassName;

var testString = ClassName("test");

trace(testString); //wil trace the text "test test123"

Is it possible to somehow achieve this? When I write the costructor method like “public static function ClassName” it fails. Is there any other way?

Cheers,
Artheus