# \[AS2 OOP\] calling a method in a method

**URL:** <https://forum.kirupa.com/t/as2-oop-calling-a-method-in-a-method/194579>\
**Category:** flash\
**Created:** [July 24, 2006, 6:30pm UTC](https://forum.kirupa.com/t/as2-oop-calling-a-method-in-a-method/194579 "2006-07-24T18:30:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GizmoWolf](https://avatars.discourse-cdn.com/v4/letter/g/779978/32.png) [@GizmoWolf](https://forum.kirupa.com/u/GizmoWolf)\
**Post date:** [July 24, 2006, 6:30pm UTC](https://forum.kirupa.com/t/as2-oop-calling-a-method-in-a-method/194579/1 "2006-07-24T18:30:06Z")

</div>

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

```auto

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!

```auto

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!, …

```auto

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:-)
