how i can set selectedIndex for LinkBar

Posted on 2011-05-11
Last Modified: 2012-08-13
Hi Expert,

I am trying  to set totalPages to LinkBar selectedIndex.
linkAC.selectedIndex = totalPages;
But giving error like access to undefined property selectedIndex.
Could you please tell how i can set?
Question by:Alpita
    LVL 28

    Expert Comment

    by:Pravin Asar
    You post your code.

    Look at this one. try with Flex3 Builder.

          <mx:ArrayCollection id="lnkData">
                      <mx:Object display="Apple" value="value1" link=""/>
                      <mx:Object display="Adobe" value="value2" link=""/>
                      <mx:Object display="Google" value="value4" link=""/>
                      <mx:Object display="Microsoft" value="value3" link=""/>
                      <mx:Object display="Yahoo" value="value1" link=""/>
                      <mx:Object display="Oracle" value="value5" link=""/>
          <mx:LinkBar id="lb" dataProvider="{lnkData}" labelField="display" itemClick="trace(lb.selectedIndex); trace(lnkData.getItemAt(lb.selectedIndex).link.toString()); "/>
    LVL 28

    Accepted Solution

    Forgot to set default

          <mx:LinkBar id="lb" dataProvider="{lnkData}" labelField="display" selectedIndex="1" itemClick="trace(lb.selectedIndex); trace(lnkData.getItemAt(lb.selectedIndex).link.toString()); "/>

    Author Closing Comment

    Thank you!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
    ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now