# Error as soon as I mention that class

**URL:** <https://forum.kirupa.com/t/error-as-soon-as-i-mention-that-class/317770>\
**Category:** flash\
**Created:** [January 2, 2011, 6:01pm UTC](https://forum.kirupa.com/t/error-as-soon-as-i-mention-that-class/317770 "2011-01-02T18:01:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![OMG](https://avatars.discourse-cdn.com/v4/letter/o/9dc877/32.png) [@OMG](https://forum.kirupa.com/u/OMG)\
**Post date:** [January 2, 2011, 6:01pm UTC](https://forum.kirupa.com/t/error-as-soon-as-i-mention-that-class/317770/1 "2011-01-02T18:01:09Z")

</div>

Hi

Somebody help me because I feel like I’m playing with fire here, lol

I have a class Map which extends MovieClip. I also have a document class SmallMap which extends Map. In SmallMap.fla’s library there’s a mc that belongs to the class FirstMap.

In my main .fla:

```php
var myMap:MovieClip;

var loader:Loader=new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,done);
loader.load(new URLRequest("SmallMap.swf"));
function done(e:Event):void {
	myMap=loader.content as MovieClip;
	myMap.addMap() 
}

```

addMap is a method in Map, which creates a new FirstMap. Of course, there’s no FirstMap in Map, only in SmallMap.  
the code works fine as long as I don’t mention “Map” anywhere in my code. However, if I do mention it, then this will generate the compiler error “Call to a possibly undefined method FirstMap”

here’s the file (it’s like 25 lines max, please take a look at it)

Thanks
