# Simple event question (with code!)

**URL:** <https://forum.kirupa.com/t/simple-event-question-with-code/300477>\
**Category:** flash\
**Created:** [November 22, 2009, 3:34am UTC](https://forum.kirupa.com/t/simple-event-question-with-code/300477 "2009-11-22T03:34:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoeRocket23](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@JoeRocket23](https://forum.kirupa.com/u/JoeRocket23)\
**Post date:** [November 22, 2009, 3:34am UTC](https://forum.kirupa.com/t/simple-event-question-with-code/300477/1 "2009-11-22T03:34:43Z")

</div>

Hi Everyone!

What is the correct event listener to detect a child added to the stage?

I tried:

```php
function loadImage(url:String):void
{
imageLoader = new Loader();
imageLoader.load(new URLRequest(url));
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
imageLoader.contentLoaderInfo.addEventListener(Event.ADDED, traceLoad);
}

loadImage("test.jpg");
  
function imageLoaded(e:Event):void
 {
imageArea.addChild(imageLoader);
}

function traceLoad(e:Event):void
{
    trace("l")
}

```

…which doesn’t work. I also tried ADDED\_TO\_STAGE but that doesn’t fire it either. Do you know the correct way to detect when the child is added? Perhaps I should be attaching the listener to the parent instead?

Thanks in advance, I haven’t been able to find a solution for this.

Ryan
