Consider using Repeater to manipulate the ViewStack children.
Tracy ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Swamy Nathan Sent: Wednesday, May 07, 2008 4:13 AM To: [email protected]; [EMAIL PROTECTED] Subject: [flexcoders] Re: How to create Viewstack Programmatically. Yes its working fine without removing the canvas... i am directly add the tabnavigator to viewstack. am not using any canvas. On Wed, May 7, 2008 at 10:21 AM, Swamy Nathan <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: Hi Folks, First i am create the empty view stack to the application <mx:ViewStack id="Props" width="920" visible="true" bottom="10" height="134" x="10"> </mx:ViewStack> and then i am reading the xml and create the canvas inside controls and then i add the canvas to the Props viewstack Props.addchild(prpcanvas); and also am using the Props.addchildAt(prpcanvas); but its work for the first time, and the next time will add the another canvas its return an error RangeError: Error #2006: The supplied index is out of bounds. at flash.display::DisplayObjectContainer/getChildAt() at mx.core::Container/getChildAt()[E:\dev\3.0.x\frameworks\projects\framewo rk\src\mx\core\Container.as:2332] at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::getScroll ableRect()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\Contai ner.as:4201] at mx.core::Container/createContentPaneAndScrollbarsIfNeeded()[E:\dev\3.0.x \frameworks\projects\framework\src\mx\core\Container.as:4161] at mx.core::Container/validateDisplayList()[E:\dev\3.0.x\frameworks\project s\framework\src\mx\core\Container.as:2689] at mx.managers::LayoutManager/validateDisplayList()[E:\dev\3.0.x\frameworks \projects\framework\src\mx\managers\LayoutManager.as:602] at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.0.x\framewor ks\projects\framework\src\mx\managers\LayoutManager.as:675] at Function/http://adobe.com/AS3/2006/builtin::apply() <http://adobe.com/AS3/2006/builtin::apply%28%29> at mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.0.x\frameworks\proj ects\framework\src\mx\core\UIComponent.as:8460] at mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.0.x\frameworks\proje cts\framework\src\mx\core\UIComponent.as:8403] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent()[E:\dev\3.0.x\frameworks\projects\fr amework\src\mx\core\UIComponent.as:9051] at mx.managers.dragClasses::DragProxy/mouseUpHandler()[E:\dev\3.0.x\framewo rks\projects\framework\src\mx\managers\dragClasses\DragProxy.as:500] how can i rectify this problem.... How to create a viewstack programmatically. Please Reply me... -- Thanks & Regards Swaminathan. M -- Thanks & Regards Swaminathan. M

