3 Replies Latest reply on Jun 11, 2010 9:54 AM by Flex harUI

    Navigation Help Please

    Whitetimer Level 1

      Hi All ...

       

      Been away from Flex for a while and now i'm back  Anyway i am working on a project and need some help with the navigation.

       

      I Have the application page with a ViewStack Component.  In the ViewStack i have 5 Custom Components.

       

       

      <mx:ViewStack id="vs">

          <VHome id="1" />

          <VAbout id="2" />

          <VProducts id="3" />

          <VSupport id="4" />

          <VContact id="5" />

      </mx:ViewStack>

       

       

      Custom Component with 4 panels and Buttons within the panels

       

      <s:Group id="VHome">

          <s:Panel id="1">

              <s:TextArea />

              <s:Button id="11"  click="clickHandler(event)"/>

              <s:Button id="12"  click="clickHandler(event)"/>

              <s:Button id="13"  click="clickHandler(event)"/>

          </s:panel>

       

          <s:Panel id="2">

              <s:TextArea />

              <s:Button id="21"  click="clickHandler(event)"/>

              <s:Button id="22"  click="clickHandler(event)"/>

              <s:Button id="23"  click="clickHandler(event)"/>

          </s:panel>

       

          <s:Panel id="3">

              <s:TextArea />

              <s:Button id="31"  click="clickHandler(event)"/>

              <s:Button id="32"  click="clickHandler(event)"/>

              <s:Button id="33"  click="clickHandler(event)"/>

          </s:panel>

       

          <s:Panel id="4">

              <s:TextArea />

              <s:Button id="41"  click="clickHandler(event)"/>

              <s:Button id="42"  click="clickHandler(event)"/>

              <s:Button id="43"  click="clickHandler(event)"/>

          </s:panel>

      </s:Group>

       

      What i am trying to do is to get the user to click a button on one of the Panels in VHome to navigate the rest of the ViewStack, but i am having some problems.

       

      I have this in the VHome Custom Component

       

      <fx:Metadata>

      [Event(name="navigation", type="flash.events.Event")]

      </fx:Metadata>

       

      <fx:Script>

      <![CDATA[

      import Events.NavigationEvents;

      private function clickHandler(event:Event):void

      {

      var e:Events = new Events("navigation");

      dispatchEvent(e);

      }

      ]]>

      </fx:Script>

       

       

      How do i set up the ClickHandler Function on the Application page ???

       

      Many Thanks

       

      Whitetimer