# Calling a function in the document class form another class

**URL:** <https://forum.kirupa.com/t/calling-a-function-in-the-document-class-form-another-class/319962>\
**Category:** Uncategorized\
**Created:** [March 9, 2011, 11:47pm UTC](https://forum.kirupa.com/t/calling-a-function-in-the-document-class-form-another-class/319962 "2011-03-09T23:47:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rosquito](https://avatars.discourse-cdn.com/v4/letter/r/ea666f/32.png) [@rosquito](https://forum.kirupa.com/u/rosquito)\
**Post date:** [March 9, 2011, 11:47pm UTC](https://forum.kirupa.com/t/calling-a-function-in-the-document-class-form-another-class/319962/1 "2011-03-09T23:47:57Z")

</div>

Hi there,

I’m an AS3 newbie and trying to have a class reference a variable within the document class and have scoured the web but can’t seem to find a solution. It seems relatively simple, but is a major stumbling block for me. Any help you can provide would be greatly appreciated!

I want the variable in the doc class to increment each time a draggable object is within bounds and snapped to a box in the subclass. By tracking successful snaps, the objects will be placed one under the other each time. I’ve attached the files in hopes you may have a chance to look at them 🙂

TIA, brian
