# Global functions, referencing funcs in document class

**URL:** <https://forum.kirupa.com/t/global-functions-referencing-funcs-in-document-class/236981>\
**Category:** Uncategorized\
**Created:** [August 25, 2007, 10:05pm UTC](https://forum.kirupa.com/t/global-functions-referencing-funcs-in-document-class/236981 "2007-08-25T22:05:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmerino](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@dmerino](https://forum.kirupa.com/u/dmerino)\
**Post date:** [August 25, 2007, 10:05pm UTC](https://forum.kirupa.com/t/global-functions-referencing-funcs-in-document-class/236981/1 "2007-08-25T22:05:35Z")

</div>

Ok, maybe someone can help me out with this. :hitman2:

I’ve got a Document class for my project which handles a bunch of the applications functions. I have another class that extends MovieClip, And I create a bunch of instances of this class (movieclip) in my movie. I want to be able to call a function that is in my DOCUMENT CLASS from my other class (which is in a separate AS file).

Is this possible? I have it working but I have to pass in “this” to the constructor and then use that reference to call the function. Seems a bit sloppy, is that the only way to do it?

What about global functions? What is the best way to have a function that can be called from any class?
