# Extended document class

**URL:** <https://forum.kirupa.com/t/extended-document-class/311619>\
**Category:** Uncategorized\
**Created:** [July 12, 2010, 5:23pm UTC](https://forum.kirupa.com/t/extended-document-class/311619 "2010-07-12T17:23:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marlfox](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@marlfox](https://forum.kirupa.com/u/marlfox)\
**Post date:** [July 12, 2010, 5:23pm UTC](https://forum.kirupa.com/t/extended-document-class/311619/1 "2010-07-12T17:23:44Z")

</div>

Hi all,

I’m having some trouble with using a Document class in Flash CS3 that is an extension of another class. When I do this, I can no longer make references to MovieClips with instance names on the stage.

Here’s an example. I have a class called Minigame that extends MovieClip and then a class Shooter that extends Minigame. So the relationship looks like:

MovieClip \<-- Minigame \<-- Shooter

I want to use Shooter as my Document class in the Flash file Shooter.FLA. However, when I do this, I am unable to directly access any instance names of MovieClips on the stage of Shooter.FLA from Shooter.as. In other words, if I try to write the line:

var mc:MovieClip = this.instanceName;

in Shooter.as, I get the error:

1120: Access of undefined property instanceName.

even though there is a MovieClip on the stage with that instance name. Does anyone know what’s going on under the hood well enough to explain why this isn’t working and perhaps suggest a workaround? Thanks.

-John
