I think that you're not trying to make enough of them.  If you try
1,000,000, you'll have more choices. :)  Seriously, this is like the
client that asks, "Why is the application slow?  We're only getting
50,000 nested objects back from the server."

-TH

--- In [email protected], "ew6014" <ew6...@...> wrote:
>
> 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