2 Replies Latest reply on Jun 5, 2009 7:32 AM by eb_dev

    [AS2.0] Best way to use a different AccordionHeader class?




      I've been working on creating wrapping text version of the Button class (extending from SimpleButton) which I want to use in conjunction with an Accordion component as a new AccordionHeader.
      I've succesfully created my new TextWrappingButton class but need to know what the best way is to implement it in the Accordion.


      I understand that the AccordionHeader extends the Button class and the Accordion uses instances of the AccordionHeader class for it's button / headers so logically (perhaps through my ignorance) it seems the way to get to my goal is to make a new AccordionHeader which extends TextWrappingButton and then make a new Accordion class which uses the new TextWrappingAccordionHeader class.


      This seems really overkill though as I'll be duplicating alot of stuff, is there another way to do this?





        • 1. Re: [AS2.0] Best way to use a different AccordionHeader class?
          Ned Murphy Adobe Community Professional & MVP

          If there were some way for you to modify the accordian side of things to be able to accept a value during instantiation that would tell it whether to use one button type or the other, you may be able to keep the accordian stuff as one class with two options.  I am not familiar with the Accordian class and friends, so that's the best I can offer.


          Otherwise, I'd say go for what you described.  The working file isn't going to care since it won't see any duplication.

          1 person found this helpful
          • 2. Re: [AS2.0] Best way to use a different AccordionHeader class?
            eb_dev Level 1

            Hi Ned,


            Thanks for your reply, I hadn't thought of doing it that way although it would mean modifying the flash Accordion class which probably isn't ideal. I went down the route of creating my own Accordion Component, Accordion class and AccordionHeader subclass to see how far i could get and i think i'm most of the way there now as I've got my accordion to display, well kind of , i'm having some issues with that at the mo, must be some referencing problem.


            Still open to ideas if anyone has some cents to spare?