2 Replies Latest reply on Aug 28, 2010 6:05 AM by dgamma

    How to check if spark navigator content has been clicked

    dgamma

      I've been trying to run a function to call when the navigator conent has been clicked or changed, but none of these events seem to be working? any ideas?

      Thanks

      daniel

        • 1. Re: How to check if spark navigator content has been clicked
          ShardulSingh Level 3

          Hi,

          All is working fine.Pls check with the example below. You can click on the red navigator content then you will find a Alert. And also when you will

          add a button isnide the navigator content then also you will find another Alert.Let me know if you have any issue with this.

           

           

           

          <?xml version="1.0" encoding="utf-8"?>
          <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                         xmlns:s="library://ns.adobe.com/flex/spark"
                         xmlns:mx="library://ns.adobe.com/flex/mx"
                         minWidth="955" minHeight="600">

           

              <fx:Script>
                  <![CDATA[
                      import mx.controls.Alert;
                      import mx.events.FlexEvent;
                     
                      import spark.components.Button;
                      protected function navigatorcontent1_clickHandler(event:MouseEvent):void
                      {
                          Alert.show("Working fine.");
                      }

           

                      protected function navigatorcontent1_updateCompleteHandler(event:FlexEvent):void
                      {
                          Alert.show("navigatorContent is updated.")
                      }

           


                      protected function addToNavigatorcontent(event:MouseEvent):void
                      {
                          var btn : spark.components.Button = new spark.components.Button();
                          btn.label = "Added on navigatorContennt";
                          btn.width = 100;
                          btn.height = 50;
                          navigatorContent.addElement(btn);
                      }

           

                  ]]>
              </fx:Script>

           

              <fx:Declarations>
                  <!-- Place non-visual elements (e.g., services, value objects) here -->
              </fx:Declarations>
              <mx:VBox>
                  <s:NavigatorContent id="navigatorContent" width="400" height="150" backgroundColor="0xFF0000" click="navigatorcontent1_clickHandler(event)" updateComplete="navigatorcontent1_updateCompleteHandler(event)">
                     
                  </s:NavigatorContent>
                 
                  <mx:Button label="Add something to NavigatorContent" width="250" click="addToNavigatorcontent(event)" />
              </mx:VBox>
             
          </s:Application>

           

           

           

           

           

           

           

          with Regards,

           

          Shardul Singh Bartwal

          1 person found this helpful