Quick and dirty using the example code at
http://livedocs.adobe.com/flex/3/langref/mx/containers/Accordion.html#in\
cludeExamplesSummary...

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="vertical"
     creationComplete="onCreationComplete()">
     <mx:Script>
         <![CDATA[
             import mx.containers.Accordion;
             import mx.controls.Label;
             import mx.containers.VBox;

             private var myAccordion:Accordion = new Accordion();
             private var vBox1:VBox = new VBox();
             private var vBox1Label:Label = new Label();
             private var vBox2:VBox = new VBox();
             private var vBox2Label:Label = new Label();
             private var vBox3:VBox = new VBox();
             private var vBox3Label:Label = new Label();

             private function onCreationComplete():void
             {
                 myAccordion.percentHeight = 100;
                 myAccordion.percentWidth = 100;

                 vBox1.label = "Accordion Button for Panel 1";
                 vBox2.label = "Accordion Button for Panel 2";
                 vBox3.label = "Accordion Button for Panel 3";

                 vBox1Label.text = "Accordion container panel 1";
                 vBox2Label.text = "Accordion container panel 2";
                 vBox3Label.text = "Accordion container panel 3";

                 vBox1.addChild(vBox1Label);
                 vBox2.addChild(vBox2Label);
                 vBox3.addChild(vBox3Label);

                 myAccordion.addChild(vBox1);
                 myAccordion.addChild(vBox2);
                 myAccordion.addChild(vBox3);

                 addChild(myAccordion);
             }
         ]]>
     </mx:Script>
</mx:Application>




--- In [email protected], "timgerr" <tgallag...@...> wrote:
>
> So I have been reading actionscript on how to do this and I am running
into some troubles, I seem to have to use createSegment but I dont see
it in flex, here is what I mean:
> var a:Accordion = new Accordion();
> a.createSegment("Some Parameters");
>
> I dont get a.createSegment in my list of things I can add to a.  What
am I doing wrong?
>
> Thanks,
> timgerr
>
>
> --- In [email protected], "timgerr" tgallagher@ wrote:
> >
> > Can some one point me to an example of an accordion done in
actionscript?  I want to create a menu with an accordion in it in
actionscript but cannot find any examples on how to do the accordion.
> >
> > Thanks,
> >
> > timgerr
> >
>

Reply via email to