# Adding a MovieClip to the Stage from a Class function

**URL:** <https://forum.kirupa.com/t/adding-a-movieclip-to-the-stage-from-a-class-function/278360>\
**Category:** flash\
**Created:** [December 28, 2008, 4:46pm UTC](https://forum.kirupa.com/t/adding-a-movieclip-to-the-stage-from-a-class-function/278360 "2008-12-28T16:46:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![darthjones](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@darthjones](https://forum.kirupa.com/u/darthjones)\
**Post date:** [December 28, 2008, 4:46pm UTC](https://forum.kirupa.com/t/adding-a-movieclip-to-the-stage-from-a-class-function/278360/1 "2008-12-28T16:46:28Z")

</div>

Of course, it’s easy enough to do when not working with classes. Basically, I want to be able to execute a function from one of my classes that does the following -

```auto
function buildArea():void
{
    var i:Number = 1;
    this["tile_" + i] = new TileSet01(); // a for-loop will be used later, so this is necessary
    addChild( this["tile_" + i] );
}

buildArea();

```

If I remember correctly, I did this in AS2 using Delegates. Unfortunately, it doesn’t seem to work the same way in AS3…
