Calling constructor in condition: A function call on a non-function was attempted

Hi guys,

Please help me somebody with this cos I have really no idea. I have made a simply condition calling a constructor of a class. Today I had to add an “else if”, what caused the compilator to show me “A function call on a non-function was attempted.”…


function loadIt() {
    if (var1 == "1") {
        var a:SomeClass = new SomeClass(true);
    } else if(var2 == "1"){
         var a:SomeClass = new SomeClass(false); //<- if this is not here, everything works fine
    } else {
        var b:SomeOtherClass = new SomeOtherClass();
        b.init();
    }
}

Any ideas? Thanks for any help!

Poco