[AS2 OOP] calling a method in a method

Hi everyone :smiley:
i’m not quite sure how to phrase my problem, so i’ll examplify:


class A{
    function A(){
        trace("construct");
    }
    private function moo(){
        trace("moo!");
    }
    private function cow(){
        trace("start mooing");
            moo();
    }
}

this does what I expect it to: construct, start mooing, moo!


class A{
    function A(){
        trace("construct");
    }
    private function moo(){
        trace("moo!");
    }
    private function cow(){
        trace("start mooing");
        _root.onEnterFrame = function(){
            trace("moo!")
        }
    }
}

this also does what I expect it to: construct, start mooing, moo!, moo!, moo!, …


class A{
    function A(){
        trace("construct");
    }
    private function moo(){
        trace("moo!");
    }
    private function cow(){
        trace("start mooing");
        _root.onEnterFrame = function(){
            moo();
        }
    }
}

yet this doesn’t, I’d expect it to: construct, start mooing, moo!, moo!, moo!, …
yet the moo! moo! moo! doesn’t appear, as if moo() never gets called it all.
so what I’m I doing wrong? I:-)