作者deepinside (守护勇气)
看板Flash
标题[问题] flex repeater的用法
时间Wed Aug 12 23:47:42 2009
小妹最近想尝试用flex 的repeater来产生想要的呈现的样子
但是一直没办法成功~"~
以下是我测试用的程式码
<?xml version="1.0" encoding="utf-8"?>
<mx:Application creationComplete="init()"
xmlns:mx="
http://www.adobe.com/2006/mxml" layout="absolute"
xmlns:ns1="Components.*">
<mx:Script>
<![CDATA[
[Bindable]
private var testArray:Array = new Array();
private function init():void{
for(var i:int=1; i<10; i++){
testArray.push(i);
}
}
]]>
</mx:Script>
<ns1:testMonthBlock x="10" y="10" id="blk0"></ns1:testMonthBlock>
<mx:Repeater id="myRp" dataProvider="{testArray}">
<mx:HBox x="10" y="10" width="694" height="22">
<mx:Label text="{String(myRp.currentItem)}" width="100" textAlign="right"
fontSize="12"/>
</mx:HBox>
</mx:Repeater>
</mx:Application>
想请教大大们 哪出了问题?
执行时都没有东西... >"<
或是套件的使用方法、语法有错??
另外,关於array以及 arraycollection的差异
虽然有查过资料了...但还是搞不懂~"~
麻烦大大们也顺便解答一下
谢谢^^
P.S. testMonthBlock是另外写的component
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 218.171.60.189
※ 编辑: deepinside 来自: 218.171.60.189 (08/13 00:54)
1F:→ aitch:Array与ArrayCollection的差异在於AC的大小是可变动的 08/13 16:16
2F:→ aitch:Repeater的dataProvider必须是ArrayCollection 08/13 16:18
3F:→ deepinside:嗯嗯~~ 了解!!! 谢谢aitch大大:) 08/14 16:04
4F:→ deepinside:另外 我也发现我repeater的位置放错了= =" 08/14 16:05