# Trouble calling method in Document Class

**URL:** <https://forum.kirupa.com/t/trouble-calling-method-in-document-class/250600>\
**Category:** flash\
**Created:** [January 30, 2008, 10:44pm UTC](https://forum.kirupa.com/t/trouble-calling-method-in-document-class/250600 "2008-01-30T22:44:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcarwile](https://avatars.discourse-cdn.com/v4/letter/j/a183cd/32.png) [@jcarwile](https://forum.kirupa.com/u/jcarwile)\
**Post date:** [January 30, 2008, 10:44pm UTC](https://forum.kirupa.com/t/trouble-calling-method-in-document-class/250600/1 "2008-01-30T22:44:13Z")

</div>

My Document Class is called “Main”. I have another class called LittleImage inside LittleImage.as. Inside of the Main class, I have “import LittleImage” defined and I can create a new instance of the LittleImage class and everything is working fine.

The instances of the LittleClass images are essentially thumbnails of larger images inside of a movieclip on the stage. I’ve created an event listener for the MouseUp on these instances of LittleImage. When the event listener fires, I want it to call a public function called doTween() that is defined in the Main class.

I am having trouble getting this to work. In LittleImage.as I have “import Main”. This throws no errors. Inside LittleImage, I’ve tried:

doTween();

This gives a compiler error: Call to a possibly undefined method doTween.

I’ve tried:

Main.doTween();

This gives a compiler error: Call to a possibly undefined method doTween through a reference with static type Class.

I’ve tried:

var m = new Main();  
m.doTween();

I get the following error when I click on the thumbnail which fires these two lines of code:  
Error: Error #2136: The SWF file file:///D|/2Archive/Work/WebDevelopment/c2008/src/2008.swf contains invalid data.  
at LittleImage/clickedUp()

What do I have to do to get this to work?

Thanks!
