Flex Repeater 多层嵌套

多層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 id="r1" dataProvider="{temparray}" >
  <mx:Repeater id="r2" dataProvider="{temparray}" >
   <mx:Repeater id="r3" dataProvider="{temparray}" count="{r2.currentIndex+1}" >
    <mx:Button id="btn" click="btn_click()" />
   </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訪問

posted on 2007-07-08 22:14 昊子 阅读(1438) 评论(0) 编辑 收藏

导航

公告


请注意,这里是公告
本Blog文章若非注明均为本人原创
未经本人同意请勿转载
From 2007-07-03

点击这里给我发消息
昵称:昊子
园龄:6年3个月
粉丝:2
关注:0

统计

搜索

 
 

常用链接

最新随笔

我的标签

随笔分类(69)

随笔档案(66)

关注博客

积分与排名

最新评论

阅读排行榜

评论排行榜

推荐排行榜