4 Replies Latest reply on Apr 7, 2008 6:02 AM by Kyle Laughlin

    Linking Accordion based button to View Stack

    Kyle Laughlin
      I am a complete newbie. Please help. I have an accordion based button that I would like to use to change the display of the viewstack. The Accordion is my main application navigation. Inside of each "section" of the Accordion are a number of buttons which should change the content of the "main" section of the application. I have been looking at Lydia.com videos and Total Training videos and perusing my books, but alas! I can't not find a solution. Could some kind GURU help raise me from complete newbie status to newbie status class 2?
        • 1. Linking Accordion based button to View Stack
          Gregory Lafrance Level 6
          I was going to attach some code here, but all the <, >, etc. become <, > and this never use to happen before. I saw something that said to use Attach Code to add code to this message, but I tried to enclose the code in <Attach Code> and that did not work, and there is no attach code link or button so what the heck!!!
          • 2. Re: Linking Accordion based button to View Stack
            Gregory Lafrance Level 6
            <?xml version="1.0"?>
            <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">
            <mx:HBox>
            <mx:Accordion id="acd" backgroundColor="#BBBBBB" width="400" height="200">
            <mx:VBox id="accord1" label="Employee Information"
            paddingBottom="20" paddingTop="20" verticalGap="7">
            <mx:Button id="acc1_btn1" label="Show Employee Info"
            click="vs.selectedChild=ee_info"/>
            <mx:Button id="acc1_btn3" label="Show Employee Contact Info"
            click="vs.selectedChild=ee_contact"/>
            </mx:VBox>
            <mx:VBox id="accord2" label="Company Information"
            paddingBottom="20" paddingTop="20" verticalGap="7">
            <mx:Button id="acc2_btn1" label="Show Company Info"
            click="vs.selectedChild=comp_info"/>
            <mx:Button id="acc2_btn3" label="Show Company Contact Info"
            click="vs.selectedChild=comp_contact"/>
            </mx:VBox>
            </mx:Accordion>
            <mx:ViewStack id="vs" width="400" height="200">
            <mx:Panel id="ee_info" title="Employee Info">
            <mx:Form id="ee_info_form" width="100%">
            <mx:FormItem label="First Name:">
            <mx:Label text="Carl"/>
            </mx:FormItem>
            <mx:FormItem label="Last Name:">
            <mx:Label text="Herpendocken"/>
            </mx:FormItem>
            </mx:Form>
            </mx:Panel>
            <mx:Panel id="ee_contact" title="Employee Contact">
            <mx:Form id="ee_contact_form" width="100%">
            <mx:FormItem label="Office Phone Number:">
            <mx:Label text="(408) 444-4444"/>
            </mx:FormItem>
            <mx:FormItem label="Cell Phone Number:">
            <mx:Label text="(408) 555-5555"/>
            </mx:FormItem>
            </mx:Form>
            </mx:Panel>
            <mx:Panel id="comp_info" title="Company Info">
            <mx:Form id="comp_info_form" width="100%">
            <mx:FormItem label="Company Name:">
            <mx:Label text="International Refridgeration Systems"/>
            </mx:FormItem>
            <mx:FormItem label="Company Industry:">
            <mx:Label text="Refridgeration and Cooling Systems"/>
            </mx:FormItem>
            </mx:Form>
            </mx:Panel>
            <mx:Panel id="comp_contact" title="Company Contact">
            <mx:Form id="comp_contact_form" width="100%">
            <mx:FormItem label="Headquarters Phone Number:">
            <mx:Label text="(408) 777-7777"/>
            </mx:FormItem>
            <mx:FormItem label="Headquarters Fax Number:">
            <mx:Label text="(408) 666-6666"/>
            </mx:FormItem>
            </mx:Form>
            </mx:Panel>
            </mx:ViewStack>
            </mx:HBox>
            </mx:Application>

            • 4. Re: Linking Accordion based button to View Stack
              Kyle Laughlin Level 1
              Eventually I found the problem, but thank you for responding