# addChild() and order-of-events

**URL:** https://forum.kirupa.com/t/addchild-and-order-of-events/235020
**Category:** flash
**Created:** [August 7, 2007, 8:33pm UTC](https://forum.kirupa.com/t/addchild-and-order-of-events/235020 "2007-08-07T20:33:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![axiomflash](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/axiomflash/32/3952_2.png) [@axiomflash](https://forum.kirupa.com/u/axiomflash)
#### Post date: [August 7, 2007, 8:33pm UTC](https://forum.kirupa.com/t/addchild-and-order-of-events/235020/1 "2007-08-07T20:33:50Z")

</div>

Our practice (here at the office) for display objects has been to addChild() to the stage as the last step:

```auto
var clip = new CustomSprite();
clip.x = 200;
clip.y =100;
clip.alpha = .5
clip.draw();
clip.method();
addChild(clip);

```

But, I am just realizing that in some cases (especially when creating dynamically sized objects) that we need access to the stage before executing methods. This means that we need to say:

```auto
var clip = new CustomSprite();
addChild(clip);
clip.x = 200;
clip.y =100;
clip.alpha = .5
clip.draw();
clip.method();

```

Does anyone have thoughts or advice on this? I am just wondering what would be the best practice.
