hi sherif, Thanx for replying , i dont know what mistake i did, but parentApplication was not working. I got it working by importing mx.core.Application ( virat on flex india list helped me ). i.e. var vs:ViewStack = Application.application.viewstack1 as ViewStack; vs.selectedIndex = 1;
On Thu, Mar 6, 2008 at 11:15 AM, Sherif Abdou <[EMAIL PROTECTED]> wrote: > why access parentApplication?? > > just do > > this.parent.selectedIndex=whatever > > > ----- Original Message ---- > From: YOGESH JADHAV <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED]; flexcoders@yahoogroups.com > Sent: Wednesday, March 5, 2008 11:06:58 PM > Subject: [flexcoders] how to do this > > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.adobe. com/2006/ > mxml<http://www.adobe.com/2006/mxml>" > layout="absolute" xmlns:ns1="*"> > <mx:ViewStack x="10" y="10" id="viewstack1" width="100%" > height="100%"> > > <ns1:FirstView id="two"/> > > <ns1:SecondView id="one"/> > > </mx:ViewStack> > > </mx:Application> > > <?xml version="1.0" encoding="utf-8"?> > <mx:Canvas xmlns:mx="http://www.adobe. com/2006/ > mxml<http://www.adobe.com/2006/mxml>" > width="100%" height="100%"> > <mx:Button x="167" y="186" label="GoToFirst" click="go();"/> > <mx:Script> > <![CDATA[ > > public function go():void > { > // viewstack1.selected Child = second; > // this.parentApplicat ion.viewstack1. selectedChild = > this.parentApplicat ion.second; > } > ]]> > </mx:Script> > </mx:Canvas> > > > <?xml version="1.0" encoding="utf-8"?> > <mx:Canvas xmlns:mx="http://www.adobe. com/2006/ > mxml<http://www.adobe.com/2006/mxml>" > width="100%" height="100%"> > <mx:Button x="167" y="186" label="GotoSecond"/> > > </mx:Canvas> > > > Is there any simple solution ( other than firing custom event )? Sorry for > reposting, but this may be more clear than earlier one. > -- > > > Regards, > Yogesh > > > ------------------------------ > Never miss a thing. Make Yahoo your > homepage.<http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs> > > -- Regards, Yogesh