Actionscript 3 在flash builder 4.6中动态创建、添加和添加EventListener项

Actionscript 3 在flash builder 4.6中动态创建、添加和添加EventListener项,actionscript-3,apache-flex,for-loop,addeventlistener,flashbuilder4,Actionscript 3,Apache Flex,For Loop,Addeventlistener,Flashbuilder4,我正在使用Adobe Flash Builder 4.6,并尝试将创建,添加和添加到我动态创建的对象中,在as2中,我是通过以下方式完成的: for(i=0;i<10;i++){ abc[i]doSomeThing; } 对于(i=0;i您必须在flash中使用AS3.0 for(var i:int=0;i<10;i++){ abc[i].addEventListener(MouseEvent.CLICK,doSomeThing); } function doS

我正在使用Adobe Flash Builder 4.6,并尝试将
创建
添加
添加到我动态创建的对象中,在as2中,我是通过以下方式完成的:

for(i=0;i<10;i++){
    abc[i]doSomeThing;
}

对于(i=0;i您必须在flash中使用AS3.0

for(var i:int=0;i<10;i++){

  abc[i].addEventListener(MouseEvent.CLICK,doSomeThing);

}

 function doSomeThing(event:MouseEvent):void
{
   switch(event.target)
{
    case abc[0]:
    //statements for object 1;
    break;
    case abc[1]:
    //statements for object 2;
    break;
    '
    '
    '
    '
    '
    '
}
}

for(var i:int=0;类似这样的东西?我不明白你在问什么。谢谢你的帮助,但我没有得到要点;我如何创建和添加-例如textinputs-items我的意思是如何在for循环中创建文本输入并添加到面板容器中,如panel.addItem(abc[i]);