# Call function in creating class

**URL:** <https://forum.kirupa.com/t/call-function-in-creating-class/286367>\
**Category:** Uncategorized\
**Created:** [April 14, 2009, 3:04pm UTC](https://forum.kirupa.com/t/call-function-in-creating-class/286367 "2009-04-14T15:04:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bpdp](https://avatars.discourse-cdn.com/v4/letter/b/c0e974/32.png) [@bpdp](https://forum.kirupa.com/u/bpdp)\
**Post date:** [April 14, 2009, 3:04pm UTC](https://forum.kirupa.com/t/call-function-in-creating-class/286367/1 "2009-04-14T15:04:27Z")

</div>

Hi All,  
I have “class A” that makes a bunch of objects from “class B”

class A

```auto

public function classA(){    
            for(var i:int = 1; i<=num; i++) {
                var b:classB = new classB(i);
                addChild(d);
            }
        }

public function checkOverlap() {
            trace('checkOverlap has been called');
}

```

I need to call a function in “class A” from “class B” but I’m not sure how to do that.

class B

```auto

public function stoppedMoving() {
         // check for overlap in "class A" here.
}

```
