惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Security Blog
Microsoft Security Blog
Apple Machine Learning Research
Apple Machine Learning Research
美团技术团队
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
G
Google Developers Blog
阮一峰的网络日志
阮一峰的网络日志
The Cloudflare Blog
J
Java Code Geeks
Martin Fowler
Martin Fowler
M
MIT News - Artificial intelligence
IT之家
IT之家
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
Google DeepMind News
Google DeepMind News
小众软件
小众软件
V
V2EX
Hugging Face - Blog
Hugging Face - Blog
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Jina AI
Jina AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
B
Blog

博客园 - 昊子

工作流参考模型(Workflow Reference Model) DNN default document的异常错误 如何使用GoogleCode提供的SVN Source Control服务 Norton PartitionMagic 8.0 Resizing Boot Partition 智能提示和那些值得崇拜的人 推荐一个Flex & AIR皮肤站点 SessionDiskCache 0.1版发布 Flex locale 从没走远 SubmitMask 1.0 发布 如何获取Footer中的子控件 DNN学习笔记 之一 配置 使用NHibernate时产生的一个错误 NHibernate官方文档 之 NHibernate指南-前言 C#反转单向链表 C#事件编程 静态构造函数和静态成员变量初始化的调用时间 NHibernate和SqlImage 结束无谓的讨论吧
Flex Repeater 多层嵌套
昊子 · 2007-07-08 · via 博客园 - 昊子

多層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訪問