# Children Change Event

**URL:** <https://forum.kirupa.com/t/children-change-event/282564>\
**Category:** flash\
**Created:** [February 23, 2009, 7:16pm UTC](https://forum.kirupa.com/t/children-change-event/282564 "2009-02-23T19:16:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![snozbunny](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@snozbunny](https://forum.kirupa.com/u/snozbunny)\
**Post date:** [February 23, 2009, 7:16pm UTC](https://forum.kirupa.com/t/children-change-event/282564/1 "2009-02-23T19:16:05Z")

</div>

Hi guys,

I’m building a center stage object and I wanted to know if there’s any way to add a event listener that checks if the children have changed in size…

```php

package com.centerstage
{
    import flash.display.Stage;
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.events.Event;

    public class centerstage extends Sprite
    {
        private var swfStage:Stage;
        private var targetFunction:Array = new Array;
        private var targetObject:Array = new Array;
        private var resizeTarget:Sprite;

        public function centerstage(swfStage:Stage, targetObject:Array = null, targetFunction:Array = null, x:Number = 0, y:Number = 0):void
        {
            this.swfStage = swfStage;
            this.targetObject = targetObject;
            this.targetFunction = targetFunction;

            swfStage.scaleMode = StageScaleMode.NO_SCALE;
            swfStage.align = StageAlign.TOP_LEFT;
            swfStage.addChild(this);
            
// this.addEventListener(Event.????????, resizeDisplay);
        }

        public function resizeDisplay(event:Event = null):void
        {
            this.scaleX = 1;
            this.scaleY = 1;
            this.x = Math.round((swfStage.stageWidth - this.width)/2);
            this.y = Math.round((swfStage.stageHeight - this.height)/2);
        }
    }
}

```

This seems like it should be available but I can’t find a reference.

Thx! :d:
