# Trouble with MovieClip linkage and inheritance

**URL:** <https://forum.kirupa.com/t/trouble-with-movieclip-linkage-and-inheritance/290652>\
**Category:** flash\
**Created:** [June 17, 2009, 5:29pm UTC](https://forum.kirupa.com/t/trouble-with-movieclip-linkage-and-inheritance/290652 "2009-06-17T17:29:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wmarcello](https://avatars.discourse-cdn.com/v4/letter/w/b5e925/32.png) [@wmarcello](https://forum.kirupa.com/u/wmarcello)\
**Post date:** [June 17, 2009, 5:29pm UTC](https://forum.kirupa.com/t/trouble-with-movieclip-linkage-and-inheritance/290652/1 "2009-06-17T17:29:36Z")

</div>

I’ll try to explain my problem as clearly as possible. I have a MovieClip on stage (and inside it are two more MovieClips name mc1 and mc2). In the Library I’ve set the linkage base class of this MovieClip to point to a custom class I wrote. Let’s call it ClassA:

```auto

package myclass
{
    import flash.display.MovieClip

    //properties
    private var _mc1:MovieClip;
    private var _mc2:MovieClip;

    public class ClassA extends MovieClip
    {
        //constructor
        public function ClassA()
        {
            //mc1 and mc2 are MovieClips inside my base clip
            //that i want to store as private variables
            _mc1 = mc1;
            _mc2 = mc2;
        }
    }
}

```

Now, this actually works fine with no errors, and I am able to access mc1 and mc2 just fine within the class.

My problem comes when instead of making the base class ClassA, I actually make the base class ClassB which extends ClassA:

```auto

package myclass
{
    public class ClassB extends ClassA
    {
        //constructor
        public function ClassB()
        {
            super();
        }
    }
}

```

Once I do that and test the movie, I get the following errors:  
1120: Access of undefined property mc1  
1120: Access of undefined property mc2

What am I doing wrong? Even if I go back into ClassA and set the private variables as protected, I am still getting the same errors.
