多層Repeater嵌套控件訪問問題
多層嵌套可以直接通過控件ID訪問同名控件的多維數組
但數組維度固定,如有例外則無法通過此方法訪問

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
 <mx:Script>
  <![CDATA[
   
   [Bindable]
   public var temparray:Array = [1,2,3]
   
   
   public function btn_click():void
   {
    //trace (btn[2][2][2]);
    trace (btn);
   }
  ]]>
 </mx:Script>
 <mx:Repeater />
   </mx:Repeater>
   
  </mx:Repeater>
 </mx:Repeater>
</mx:Application>

結果
,Repeater0.btn[0][1][0],Repeater0.btn[0][1][1],btn[0][2][2],Repeater0.btn[0][2][0],Repeater0.btn[0][2][1],Repeater0.btn[0][2][2],,Repeater0.btn[1][1][0],Repeater0.btn[1][1][1],btn[1][2][2],Repeater0.btn[1][2][0],Repeater0.btn[1][2][1],Repeater0.btn[1][2][2],Repeater0.btn[2][0][0],Repeater0.btn[2][1][0],Repeater0.btn[2][1][1],Repeater0.btn[2][2][0],Repeater0.btn[2][2][1],Repeater0.btn[2][2][2]

btn[0][0] btn[1][0] btn[2][0]無法通過 ID訪問

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-30
  • 2022-01-07
猜你喜欢
  • 2021-06-09
  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
相关资源
相似解决方案