Use selectedChild instead of selectedIndex if possible. Working example below.
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" width="100%" height="100%" initialize="initApp();"> <mx:Script> <![CDATA[ function initApp() { *acc.selectedChild = box2;* } ]]> </mx:Script> <mx:Accordion id="*acc*" width="100%" height="100%"> <mx:Box id="box1" label="Box 1" width="100%" height="100%"> <mx:Label text="Box 1" /> </mx:Box> <mx:Box id="*box2*" label="Box 2" width="100%" height="100%"> <mx:Label text="Box 2" /> </mx:Box> </mx:Accordion> </mx:Application> Regards Sree msloumac wrote: > Hi, > Can anyone tell me whether is is possible to navigate the accordion > using actionscript rather that via button clicks. > > these are the options I have tried: > > _root.accordionname.selectedIndex=1; > > _parent.accordionname.selectedIndex=1; > > I am executing the code after listening to a broadcast event > ('accordianChange'), the event is being broadcast and the listener is > responding but the accordion is not chnaging. > > Also the creationPolicy of the accordion is set to "all". > > If someone could confirm whether it is possible to change the > accordion stack or offer any ideas I would be very grateful. > > Thanks > > L > > > > > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com > > > > SPONSORED LINKS > Web site design development > <http://groups.yahoo.com/gads?t=ms&k=Web+site+design+development&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=L-4QTvxB_quFDtMyhrQaHQ> > > Computer software development > <http://groups.yahoo.com/gads?t=ms&k=Computer+software+development&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=lvQjSRfQDfWudJSe1lLjHw> > > Software design and development > <http://groups.yahoo.com/gads?t=ms&k=Software+design+and+development&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=1pMBCdo3DsJbuU9AEmO1oQ> > > > Macromedia flex > <http://groups.yahoo.com/gads?t=ms&k=Macromedia+flex&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=OO6nPIrz7_EpZI36cYzBjw> > > Software development best practice > <http://groups.yahoo.com/gads?t=ms&k=Software+development+best+practice&w1=Web+site+design+development&w2=Computer+software+development&w3=Software+design+and+development&w4=Macromedia+flex&w5=Software+development+best+practice&c=5&s=166&.sig=f89quyyulIDsnABLD6IXIw> > > > > > ------------------------------------------------------------------------ > YAHOO! GROUPS LINKS > > * Visit your group "flexcoders > <http://groups.yahoo.com/group/flexcoders>" on the web. > > * To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of > Service <http://docs.yahoo.com/info/terms/>. > > > ------------------------------------------------------------------------ > ------------------------ Yahoo! Groups Sponsor --------------------~--> Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM --------------------------------------------------------------------~-> -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

