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…
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: