Ah solved it tonight. It may not be the best way but for anyone interested
this is the code:
var currentVid:int = 0;
var dsl:int = xPhoto.parent().children().length();
if ((xPhoto.childIndex() + 1) + currentVid >= dsl)
{
currentVid = 0;
flvPlayback.play("data/" +
xPhoto.parent().child(0)....@source);
}
else
{
currentVid = currentVid + 1;
flvPlayback.play("data/" +
xPhoto.parent().child(xPhoto.childIndex() + currentVid)....@source);
}
________________________________
From: Manish Jethani <[email protected]>
To: [email protected]
Sent: Monday, December 22, 2008 3:36:07 PM
Subject: Re: [flexcoders] FLVPlayback using a Tree Control
On Mon, Dec 22, 2008 at 5:31 AM, Jesse <jtbr...@yahoo. com> wrote:
> private function changeHandler( event:ListEvent) :void
> {
> var selectedXML: XML = event.target. selectedItem as XML;
>
> if (selectedXML. name() == "video")
> {
> xPhoto = selectedXML;
> }
> }
> private function nextFLV(e:Event) :void
> {
> ?????
> }
[snip]
See if this works:
xPhoto.parent( ).child(xPhoto. childIndex( ) + 1)....@source
Basically childIndex gives you the current index, parent gives you the
parent, and from there you can increment by 1 and get the next child
in the sequence.
--
http://manishjethan i.com/