2 Replies Latest reply on Sep 14, 2010 11:08 PM by Whitetimer

    Why is this not working ?

    Whitetimer

      Hi All

       

      I have a custom navigation component which dispatches an event.

       

      <fx:Metadata>

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

      </fx:Metadata>

       

      <fx:Script>

      <![CDATA[

       

      private function navigationEventHandler(event:Event):void

      {

      var eventObj:Event = new Event("navigationClickEvent");

      dispatchEvent(eventObj);

       

      }

       

      ]]>

      </fx:Script>

       

      <s:layout>

      <s:VerticalLayout verticalAlign="middle" horizontalAlign="center" gap="5"/>

      </s:layout>

       

      <s:HGroup horizontalAlign="center" verticalAlign="middle">

       

      <mx:LinkButton id="contactBTN" width="90%" label="Contact" cornerRadius="5" click="navigationEventHandler(event)"  />

      <mx:VRule height="10" strokeColor="#000000" strokeWidth="1" />

      <mx:LinkButton width="90%" label="About Us" cornerRadius="5" />

      <mx:VRule height="10" strokeColor="#000000" strokeWidth="1" />

      <mx:LinkButton width="90%" label="Feedback" cornerRadius="5" />

       

      </s:HGroup>

       

      <mx:Spacer height="5" />

       

      <s:BorderContainer width="230" height="24" backgroundColor="#00688B" cornerRadius="11" borderVisible="true" borderColor="#FFFFFF">

      <s:layout>

      <s:VerticalLayout horizontalAlign="center" verticalAlign="middle" />

      </s:layout>

      <mx:LinkButton id="homeBTN" width="224" cornerRadius="9" height="18" label="Home" color="#FFFFFF" textAlign="center" click="navigationEventHandler(event)" />

      </s:BorderContainer>

       

      <s:BorderContainer width="230" height="24" backgroundColor="#00688B" cornerRadius="11" borderVisible="true" borderColor="#FFFFFF">

      <s:layout>

      <s:VerticalLayout horizontalAlign="center" verticalAlign="middle" />

      </s:layout>

      <mx:LinkButton id="whitetimeBTN" width="224" cornerRadius="9" height="18" label="White Time Healing" color="#FFFFFF" textAlign="center" click="navigationEventHandler(event)"/>

      </s:BorderContainer>

       

      But in the root i have this

       

      <fx:Script>

      <![CDATA[

      import mx.controls.Alert;

       

       

      private function navigationClickHandler(event:Event):void

      {

      Alert.show(event.target.id, "You Clicked A Nav Button");

      }

       

      ]]>

      </fx:Script>

       

      But the target ID does not show ..... Any thoughts ?

       

      Many Thanks