# Adding instance to stage from a movieclip linked class

**URL:** <https://forum.kirupa.com/t/adding-instance-to-stage-from-a-movieclip-linked-class/276938>\
**Category:** flash\
**Created:** [December 5, 2008, 7:08am UTC](https://forum.kirupa.com/t/adding-instance-to-stage-from-a-movieclip-linked-class/276938 "2008-12-05T07:08:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![christinelalala](https://avatars.discourse-cdn.com/v4/letter/c/90ced4/32.png) [@christinelalala](https://forum.kirupa.com/u/christinelalala)\
**Post date:** [December 5, 2008, 7:08am UTC](https://forum.kirupa.com/t/adding-instance-to-stage-from-a-movieclip-linked-class/276938/1 "2008-12-05T07:08:08Z")

</div>

Hi,  
I was trying to add an instance I created in a class to the main  
stage, like this:

```auto
var blackD:MovieClip = new blackboardinfo();
Stage.addChild(blackD);

```

it was working fine, however, after I added preload page, which will now  
load everything else as external swf, i began getting this error  
TypeError: Error #1009: Cannot access a property or method of a null object reference.

I tried to modify the code to this based on the similar questions i found online

```auto
var mc:MovieClip = new MovieClip();
addChild(mc);
var _stage:Stage = mc.stage;
_stage.addChild(blackD);

```

I still get the same error, I know it is because “stage”, but if I dont use stage, how  
can I add an instance on top of everything? thanks.
