Out of the box when using deferred instantiation the ViewStack was designed to only support animations on a child container 'hide' not 'show'.
If you only slide 'out' it should work fine, if you want to slide 'in' or both 'in' and 'out' you need to roll you own version of ViewStack and build in the support. This is something we have done, though I can't really help with the code because of copyright. You need to override selectedIndex, commitSelectedIndex, and commitProperties as well as add a function to init the selected child container. Its not really difficult, you should take a look at the adobe code in the ViewStack and basically emulate that. --- In [email protected], Alex Harui <aha...@...> wrote: > > I still believe that all children of a viewstack are created no matter the > creationpolicy. CreationPolicy affects the grandchildren. CreationComplete > on the child is long gone. Try listening to SHOW as well, and call > validateNow on the entire viewstack, not just the child. Children get their > size from the parent. > > Alex Harui > Flex SDK Developer > Adobe Systems Inc.<http://www.adobe.com/> > Blog: http://blogs.adobe.com/aharui > > From: [email protected] [mailto:[email protected]] On > Behalf Of dfalling > Sent: Friday, September 18, 2009 12:09 PM > To: [email protected] > Subject: [flexcoders] Still struggling with creation complete > > > > I have a viewstack that animates its children by sliding them in and out. It > works fine when the creationPolicy is set to all, but when it's set to auto, > uncreated views slide in blank, then render themselves. > > I thought that I could fix this by checking to see if a view has been created > yet (the only way I could figure out how to do this is > mx_internal::numChildrenCreated), and then trigger its creation with > createComponentFromDescriptor. For some reason this isn't working though- my > creationComplete function is never called...what am I doing wrong? > > override public function set selectedIndex(value:int):void > { > _lastIndex = selectedIndex; > > if(value != _lastIndex && value >= 0 && _lastIndex >= 0) > { > _newIndex = value; > var targetChild:Container = getChildAt(value) as Container; > if (targetChild.mx_internal::numChildrenCreated < 0) > { > targetChild.addEventListener(FlexEvent.CREATION_COMPLETE,child_creation,false,0,true); > createComponentFromDescriptor(targetChild.descriptor,true); > targetChild.validateNow(); > return; > } > else > { > slideTabs(_lastIndex,_newIndex); > } > } > } > > private function child_creation(event:Event):void > { > slideTabs(_lastIndex,_newIndex); > } >

