# Linking class files

**URL:** <https://forum.kirupa.com/t/linking-class-files/277153>\
**Category:** Uncategorized\
**Created:** [December 8, 2008, 6:07pm UTC](https://forum.kirupa.com/t/linking-class-files/277153 "2008-12-08T18:07:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![benny1989](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@benny1989](https://forum.kirupa.com/u/benny1989)\
**Post date:** [December 8, 2008, 6:07pm UTC](https://forum.kirupa.com/t/linking-class-files/277153/1 "2008-12-08T18:07:40Z")

</div>

Hi, i’m pretty new AS3, and i’m having problems linking a class file to my main document class. The class I want to link is a sound based class, and has play,pause buttons aswell as a volume slider, it is also linked to a mp3 file using URLRequest. When linking the sound class file(SoundSlider.as) to my main class document(Portfolio.as) I get the following error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.  
at SoundSlider$iinit()  
at Portfolio$iinit()

When attempting to link the two classes, I first added the import SoundSlider; statement to my main class, I also declared and made an instance of it,

```auto
var _soundslider:SoundSlider = new SoundSlider;

```

I then added used addChild(\_soundslider) to add it onto the stage. All the files are in the same folder. Any help would be greatly appreciated.

Many Thanks  
benny
