Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-20647

LinkBar bug with fix

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Adobe Flex SDK 3.2 (Release)
    • None
    • mx: LinkBar
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

    Description

      Steps to reproduce:

      N/A its a line of code that needs fixing.
      The problem is in this function :

      override protected function hiliteSelectedNavItem(index:int):void
      {
      var child:Button;

      // Un-hilite the current selection.
      if (selectedIndex != -1 && selectedIndex < numChildren)
      {
      child = Button(getChildAt(selectedIndex));
      child.enabled = true;
      }

      // Set new index.
      super.selectedIndex = index;

      // Hilite the new selection.
      >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
      child = Button(getChildAt(selectedIndex));
      child.enabled = false;
      >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
      }

      the highlighted 2 lines should be in a conditional as selectedIndex might be -1 and getchildat(-1) will break.
      Solution:

      replace these two lines with:

      if (selectedIndex != -1)
      {
      child = Button(getChildAt(selectedIndex));
      child.enabled = false;
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: