• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 460
  • Last Modified:

how i can set selectedIndex for LinkBar

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?
  • 2
1 Solution
Pravin AsarPrincipal Systems EngineerCommented:
You post your code.

Look at this one. try with Flex3 Builder.

      <mx:ArrayCollection id="lnkData">
                  <mx:Object display="Apple" value="value1" link="http://www.apple.com"/>
                  <mx:Object display="Adobe" value="value2" link="http://www.adobe.com"/>
                  <mx:Object display="Google" value="value4" link="http://www.google.com"/>
                  <mx:Object display="Microsoft" value="value3" link="http://www.microsoft.com"/>
                  <mx:Object display="Yahoo" value="value1" link="http://www.yahoo.com"/>
                  <mx:Object display="Oracle" value="value5" link="http://www.oracle.com"/>
      <mx:LinkBar id="lb" dataProvider="{lnkData}" labelField="display" itemClick="trace(lb.selectedIndex); trace(lnkData.getItemAt(lb.selectedIndex).link.toString()); "/>
Pravin AsarPrincipal Systems EngineerCommented:
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()); "/>
AlpitaAuthor Commented:
Thank you!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improved Protection from Phishing Attacks

WatchGuard DNSWatch reduces malware infections by detecting and blocking malicious DNS requests, improving your ability to protect employees from phishing attacks. Learn more about our newest service included in Total Security Suite today!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now