tags:

views:

435

answers:

1
var viewStack:ViewStack = new ViewStack();
viewStack.percentWidth = 100;
viewStack.percentHeight = 100;
viewStack.addChild(canVas1);
viewStack.addChild(canVas2);
viewStack.addChild(canVas3);
lb = new LinkBar();
lb.dataProvider=viewStack;

Its only displaying canVas3 contents not canVas1 and canVas2

thanks

+1  A: 

I think that's what it's supposed to do. It just puts components one on top of the other like a deck of cards, with the topmost (last added) being visible. Check this out.

SB
Thanks Michael, I know its shows in the form of deck, but when you addChild let say Area1, Area2 and Area3 its showing me only Area3 and nothing in Area1 and Area2.
Bruno
To see the other areas, you need to change the selected index on the viewstack. Look at the example I linked in the answer. You can only see one of the areas at a time.
SB
Hey SB, Can you please send the link again I dont see it in answer.
Bruno
Here ya go: http://learn.adobe.com/wiki/display/Flex/ViewStack
SB
I am trying to do it in ActionScript, the viewstack is a dataprovider to linkBar, and viewstack has multiple canvas and only the last is visible.Am I missing something to add in here.Where would I add viewStack.selectIndex?var canV_brand:Canvas = new Canvas(); canV_brand.label = "Canvas1"; canV_brand.addChild(hBox1);Same viewstack I mention in the question earlier
Bruno
try viewStack.selectedIndex=1; in your code - you can change it to whatever you want depending on which one you want to see. YOU CAN ONLY SEE ONE AT A TIME
SB
The thing is I do see the canvas3, but not canvas1 and canvas2 when I click on there respective linkbutton. for eg: not able to see Area1 and Area2 when I click there respective button.I know only one panel will be visible at a time, but I am only able to see the top most, not the first and second.
Bruno