In my ApplicationMediator, I have the following code:
var xOffset:Number = Constants.ITEM_STARTING_X_COORDINATE;
for (var i:int = 0; i <= maxNumOfItems; i++)
{
var mc:mcItem = new mcItem();
mc.name = i.toString();
viewComponent.addChild(mc);
mc.x = xOffset;
xOffset += mc.width;
facade.registerMediator (new mcItemMediator(mc));
}
From my trace statements in my code I can see that the constructor for mcItemMediator is being called maxNumOfItems times but I am only getting the onRegister being triggered for the first instance of mcItemMediator.
Here is the code for the mcItemMediator:
public class mcItemMediator extends Mediator implements IMediator
{
public static const NAME:String = "mcItemMediator";
public function mcItemMediator(viewComponent:Object):void
{
trace("mcItemMediator");
super(NAME, viewComponent);
}
override public function onRegister():void
{
trace("onRegister");
}
}