# Reference the stage from a custom class

**URL:** <https://forum.kirupa.com/t/reference-the-stage-from-a-custom-class/281258>\
**Category:** Uncategorized\
**Created:** [February 6, 2009, 4:55pm UTC](https://forum.kirupa.com/t/reference-the-stage-from-a-custom-class/281258 "2009-02-06T16:55:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alber\_Kidd](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@Alber\_Kidd](https://forum.kirupa.com/u/Alber_Kidd)\
**Post date:** [February 6, 2009, 4:55pm UTC](https://forum.kirupa.com/t/reference-the-stage-from-a-custom-class/281258/1 "2009-02-06T16:55:36Z")

</div>

I have created a custom class that extends the movie clip

on frame 1 of the main timeline I create it

var mainBox2:mainBox = new mainBox();  
addChild(mainBox2);

Now as I understand it you have to cast the parent as a MC so in the constructor of my external class I try this

var myStage:MovieClip = MovieClip(this.parent);  
trace (myStage);

I get null. What am I doing wrong?

Cheers,

AK
