# Simple question about code running when adding a child

**URL:** <https://forum.kirupa.com/t/simple-question-about-code-running-when-adding-a-child/302190>\
**Category:** flash\
**Created:** [December 23, 2009, 2:43am UTC](https://forum.kirupa.com/t/simple-question-about-code-running-when-adding-a-child/302190 "2009-12-23T02:43:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewlong](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@andrewlong](https://forum.kirupa.com/u/andrewlong)\
**Post date:** [December 23, 2009, 2:43am UTC](https://forum.kirupa.com/t/simple-question-about-code-running-when-adding-a-child/302190/1 "2009-12-23T02:43:24Z")

</div>

I have an older program that I need to update. In it I there is a movieclip that displays text. Embedded in that movieclip is a timer that makes the text disappear after a few seconds. Everything worked fine before when I was using flash to put the clips on the stage. Now I need export the symbols and use addChild to display them. My problem is that the timer is starting when I assign the clip to the variable (frame 1), not when I need it to; which is after I add the child (frame 70-ish). If I were starting over there is probably a million simple solutions to this, but I am trying to not rework everything I already made to fix this seemlingly small problem. So the basic question is, is there a way to have code run only when a child of an object is added to the display list.
