From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Matt Wicks
Sent: Wednesday, April 11, 2007 5:39 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] swap Children>?
Thanks for this - still doesn't work though ... driving me mad
Hi Matt,
Sounds like there's a problem with flex updating the screen before the
children are swapped properly.
Try validating the component after the call to swap the children, and
catching any exception thrown.
try {
container.swapChildrenAt(ind, 1);
container.validateNow();
}
catch (err:Error())
{
}
Does that make any difference?
Best Regards,
Ciarán
On 11 Apr 2007 03:44:04 -0700, Matt Wicks <matt@thewebforge.co.uk> wrote:
>
>
>
>
>
>
> Hi there all,
>
>
>
> bit of a puzzle I'm having and would be grateful for some help...
>
>
>
>
> container is a displayObjectContainer and objectToMove is a Display object
>
>
> var ind:int = container.getChildIndex(objectToMov e)
>
>
>
>
> container.swapChildrenAt(ind, 1)
>
>
> each time I run this I get an error that the supplied index is out of bounds . How can this be? ind is always 9 (of 10 childrren)??
>
>
> thanks as always
>
>
>
>
> matt
>
>