0 Replies Latest reply on Apr 4, 2007 2:05 PM by Kabillion1

    Has anybody ever used the Accordion component?

    Kabillion1

      The way an Accordion component currently functions is, when a user clicks on a segment it slides to display the content.

      I would like it to slide and display the content when the user rolls over a segment, but I can't figure out how to detect the index of the segment that the user rolls over.

      Also I can't figure out how to align the labels right and change the text to white. My code is below, please help.


      import mx.containers.Accordion;

      //skinning the segments
      Accordion.prototype.falseUpSkin = "falseUpSkin";
      Accordion.prototype.falseDownSkin = "falseDownSkin";
      Accordion.prototype.falseOverSkin = "falseOverSkin";
      Accordion.prototype.falseDisabledSkin = "falseDisabledSkin";
      Accordion.prototype.trueDownSkin = "trueDownSkin";
      Accordion.prototype.trueUpSkin = "trueUpSkin";
      Accordion.prototype.trueOverSkin = "trueOverSkin";
      Accordion.prototype.trueDisabledSkin = "trueDisabledSkin";

      //creating the segments
      var s1 = mainAccordian.createSegment("content1", "s1", "label1");
      var s2 = mainAccordian.createSegment("content1", "s2", "label2");
      var s3 = mainAccordian.createSegment("content1", "s3", "label3");
      var s4 = mainAccordian.createSegment("content1", "s4", "label4");
      var s5 = mainAccordian.createSegment("content1", "s5", "label5");
      var s6 = mainAccordian.createSegment("content1", "s6", "label6");
      var s7 = mainAccordian.createSegment("content1", "s7", "label7");

      setAccordionStyle(mainAccordian);

      // can't detect when the user rolls over a segment or get the index
      // of that segment
      s1.onRollOver = function() {

      // this only seems to detect when the user rolls over the
      // content of the selectedIndex

      };

      //aligning the text right and changing the font color to white doesn't work
      function setAccordionStyle(accordion) {
      accordion.setStyle("headerHeight", 31);
      accordion.setStyle("fontFamily", "Verdana");
      accordion.setStyle("textAlign", "right");
      _global.styles.AccordionHeader.setStyle("fontColor", "white");
      _global.styles.AccordionHeader.setStyle("fontSize", 12);
      }