Hi Kumar,
I fear one of us does not grasp the concept of the repeater class.
The way I understand it, it's for repeating the instantiating of a
child object, not for repeating the firing of events per se. I think
the solution to your question here is not unlike the slideshow example.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
creationComplete="init()">
<mx:Script>
<![CDATA[
[Bindable]
public var firstLabel:String;
[Bindable]
public var secondLabel:String;
private var timer:Timer;
[Bindable]
private var count:Number = 0;
private function init ():void
{
timer = new Timer(5000);
timer.addEventListener(TimerEvent.TIMER,
doChange);
timer.start();
doChange(null);
}
private function doChange (e:TimerEvent):void
{
var length:Number =
XML(myData).children().length();
firstLabel = XML(myData).child('student')[count
% length].name;
secondLabel =
XML(myData).child('student')[(count+1) % length].name;
count += 2;
}
]]>
</mx:Script>
<mx:XML id="myData">
<root>
<student>
<name>ABC</name>
</student>
<student>
<name>PQR</name>
</student>
<student>
<name>123</name>
</student>
<student>
<name>XYZ</name>
</student>
<student>
<name>RST</name>
</student>
</root>
</mx:XML>
<mx:VBox>
<mx:Label text="VALUE: {firstLabel}"/>
<mx:Label text="VALUE: {secondLabel}"/>
<mx:Label text="COUNT: {count}"/>
</mx:VBox>
</mx:Application>
So I don't really see how the repeater comes into it. Did I
understand your question properly?
Cheers,
Lach
On 16/12/2006, at 10:57 PM, KP wrote:
Now I want to display contents of this xmllist in a label control
with a repeater control which repeats after few sec and displays 2
items at a time which means in first 5 sec I want to display ABC
and PQR for the next 5 sec 123 and XYZ and soon.and this should
repeat I know it will need a repeater control for this but I am not
able to figure out best possible way of displaying contents.can
some one help me out of this.
Thanks
Kumar