# How to load a movieclip attached to a class from the Library?

**URL:** <https://forum.kirupa.com/t/how-to-load-a-movieclip-attached-to-a-class-from-the-library/317125>\
**Category:** flash\
**Created:** [December 11, 2010, 2:31am UTC](https://forum.kirupa.com/t/how-to-load-a-movieclip-attached-to-a-class-from-the-library/317125 "2010-12-11T02:31:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![azukizero](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@azukizero](https://forum.kirupa.com/u/azukizero)\
**Post date:** [December 11, 2010, 2:31am UTC](https://forum.kirupa.com/t/how-to-load-a-movieclip-attached-to-a-class-from-the-library/317125/1 "2010-12-11T02:31:33Z")

</div>

I’m at a dead end but I feel like the answer is right in front of me… I’m hoping someone can shed some light on this.

I’ve created a simple class that defines a scrollbar to scroll content. I’ve applied this class (ScrollBox.as) to a movieclip in the library as the Base Class.

Now, I’d like to add this movieclip to the stage with AS3. So for the Linkage, I’ve given the movieclip a class name of ‘AboutBox’. This is the code I’ve written to add it to the display list:

var aboutBox:AboutBox = new AboutBox();  
aboutBox.x = 65  
aboutBox.y = 179  
addChild(aboutBox);

When I test the swf, I get this error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.  
at ScrollBox()  
at AboutBox()  
at about\_fla::MainTimeline/frame1()

What am I missing here?

thanks
