# Access a Linkage Clip From an External Class

**URL:** <https://forum.kirupa.com/t/access-a-linkage-clip-from-an-external-class/225182>\
**Category:** flash\
**Created:** [May 9, 2007, 2:17pm UTC](https://forum.kirupa.com/t/access-a-linkage-clip-from-an-external-class/225182 "2007-05-09T14:17:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgtpritchard](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@sgtpritchard](https://forum.kirupa.com/u/sgtpritchard)\
**Post date:** [May 9, 2007, 2:17pm UTC](https://forum.kirupa.com/t/access-a-linkage-clip-from-an-external-class/225182/1 "2007-05-09T14:17:05Z")

</div>

I have a simple FLA which contains a movie clip in the library. The clip has a linkage Class of “Ball”. I know that to get this clip onto the stage I can simply type the following on the main timeline:

```auto
addChild(new Ball());

```

Doing that places the clip on the stage at runtime. Yea! Now, here is where my problem is. I delete the above code and make an instance of an external class that I have. For demonstration purposes we call the class “MyClass”. So now on my main timeline I have the following:

```auto
var myClass:MyClass = new MyClass();

```

Here is what “MyClass” looks like currently:

```auto
package{
    import flash.display.MovieClip;
    public class MyClass extends MovieClip{
        function MyClass(){
            var ball:Ball = new Ball();
            addChild(ball);
        }
    }    
}

```

This produces no errors and nothing on the stage. I have tried “import Ball;”, etc. Can someone tell me how, from the external class, to reference the symbol in the library which I have assigned a linkage (Ball) to in order to display it on the stage?

It was pointed out to me that adding “MyClass” as the Document Class will make this work. Is it the only way?

You can access the files being used here or attached to this thread: [http://www.pixelfumes.com/uploads/flashClassTest.zip](http://www.pixelfumes.com/uploads/flashClassTest.zip)
