hi guys.. any idea why the browser screws up if i were to create 100,000 
buttons like the example below? ... up to 1000 it works fine. but more then 
that it goes crazy... any thoughts?

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
creationComplete="createButtons()">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.controls.Button;
private function createButtons():void {
for(var i:int=0; i<100000; i++) {
var button:Button = new Button();
button.label = "Button " + (i+1);
button.addEventListener(MouseEvent.CLICK, clickHandler);
box.addChild(button);
}
}
private function clickHandler(event:Event):void {
var button:Button = event.currentTarget as Button;
Alert.show("You clicked: " + button.label);
}
]]>
</mx:Script>
<mx:HBox id="box" width="100%" />
</mx:Application>

Reply via email to