Answered my own question.
private function linkBarToFront():void {
var target:DisplayObject =
mainPanel.getChildByName("linkbar");
var imageIndex:Number =
mainPanel.getChildIndex(target);
var target2:DisplayObject =
mainPanel.getChildByName("myViewStack");
var imageIndex2:Number =
mainPanel.getChildIndex(target2);
trace(mainPanel.getChildByName("linkbar"));
trace(imageIndex);
trace(mainPanel.getChildByName("myViewStack"));
trace(imageIndex2);
//mainPanel.swapChildren(target,target2);
mainPanel.setChildIndex(target, imageIndex2);
mainPanel.setChildIndex(target2, imageIndex);
}
I tried using swapChildren() but it complained that it needed to be
from the same caller?!? So, this worked and I'm going with it.
--- In [email protected], "hammer995" <[EMAIL PROTECTED]> wrote:
>
> I am trying to use a linkbar but in the middle of the page. I want
> the viewstack to change behind it but it seems that the viewstack
> images always get layered on top.
>
> I tried to use the DisplayObejectContainer to setChildIndex but it
> doesn't seem to be working.
>
> Anybody have a way to do it?
>
>
> I tried to bring the linkbar to the front and the image to the back
> but i am going nowhere fast.
>
> Thanks,
> Sonny
>