A creationComplete event is dispatched very late -- after the component has already been laid out. If you set its selectedIndex early (which is what doing it in MXML does), it should work.
Gordon Smith Adobe Flex SDK Team From: [email protected] [mailto:[email protected]] On Behalf Of Tracy Spratt Sent: Monday, June 08, 2009 9:24 PM To: [email protected] Subject: RE: [flexcoders] A question about ViewStack <mx:ViewStack id="myViewStack" selectedIndex="1"> Tracy Spratt, Lariat Services, development services available ________________________________ From: [email protected] [mailto:[email protected]] On Behalf Of al-al :D Sent: Monday, June 08, 2009 11:30 PM To: [email protected] Subject: [flexcoders] A question about ViewStack Is it possible to choose which stack to display first in a ViewStack? for example <mx:ViewStack id="myViewStack"> <mx:Canvas id="firstCanvas"> <mx:DataGrid /> </mx:Canvas> <mx:Canvas id="secondCanvas"> <mx:Form /> </mx:Canvas> </mx:ViewStack> is it possible to choose secondCanvas to display first during creationComplete event? I have tried myViewStack.selectedIndex = 1 or even myViewStack.selectedChild = secondCanvas, but what happens is that the firstCanvas displays first, then it just goes to secondCanvas. I would like to skip the displaying of the firstCanvas Thanks in advance! :D

