# Reference to a function

**URL:** <https://forum.kirupa.com/t/reference-to-a-function/315217>\
**Category:** flash\
**Created:** [October 20, 2010, 12:09pm UTC](https://forum.kirupa.com/t/reference-to-a-function/315217 "2010-10-20T12:09:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Batterman](https://avatars.discourse-cdn.com/v4/letter/b/ccd318/32.png) [@Batterman](https://forum.kirupa.com/u/Batterman)\
**Post date:** [October 20, 2010, 12:09pm UTC](https://forum.kirupa.com/t/reference-to-a-function/315217/1 "2010-10-20T12:09:14Z")

</div>

hi, I got a problem.

I got this document class Main and a navbutton class. How can I connect a function from one AS3 document to another like this:

navbutton.as  
removeObjects();

Main.as  
function removeObjects(){  
//code  
}

I get this error: call to a possibly undefined method removeObjects.

Thank you
