Curiously, if you change the code in the Test.fla file, and move the lines that handle the object creation to the outside of the function, it works like it should, and stops on the first frame:
ActionScript Code:
button.buttonMode = true;
button.addEventListener(MouseEvent.CLICK, clickListener);
//this was formerly being done inside of clickListener:
var container:Container = new Container();
var container2:Container2 = new Container2();
function clickListener(e:MouseEvent) {
container.x = 150;
container.y = 150;
this.addChild(container);
container2.x = 150;
container2.y = container.y + container.height + 20;
this.addChild(container2);
}
At first I thought it might be a garbage collection issue, and that keeping references to the containers outside the function would be enough, like so:
ActionScript Code:
var container:Container;
var container2:Container;
then inside the function:
ActionScript Code:
container = new container();
container2 = new container2();
But that approach didn't work. I still think it just might be a garbage collection issue, though.