2 Replies Latest reply on Sep 17, 2010 3:17 AM by Whitetimer

    Custom Event Error Help

    Whitetimer Level 1

      Hi All


      I have a Custom Event


      package Events
           import flash.events.Event;
           public class NavigationEvent extends Event
                public var buttonID:String;
                public function NavigationEvent(type:String, buttonID:String)
                     this.buttonID = buttonID;
                override public function clone():Event
                     return new NavigationEvent(type, buttonID);


      That i am using within a Custom Component


      <?xml version="1.0" encoding="utf-8"?>
      <s:BorderContainer xmlns:fx="http://ns.adobe.com/mxml/2009" 
                             width="275" height="300">
                <!-- Place non-visual elements (e.g., services, value objects) here -->
                [Event(name="Navigation", type="Events.NavigationEvent")]
                     import Events.NavigationEvent;
                     private function buttonClickHandler(event:NavigationEvent):void
                          var eventObj:NavigationEvent = new NavigationEvent("Navigation", event.target.id);
           <s:BorderContainer width="230" height="24" backgroundColor="#00688B" cornerRadius="11" borderVisible="true" borderColor="#FFFFFF">
                     <s:VerticalLayout horizontalAlign="center" verticalAlign="middle" />
                <mx:LinkButton id="homeBTN" width="224" height="18" label="Home" cornerRadius="9" color="#FFFFFF" textAlign="center" click="buttonClickHandler(event)" />



      But i am getting this error message


      Description     Resource     Path     Location     Type
      1067: Implicit coercion of a value of type flash.events:MouseEvent to an unrelated type Events:NavigationEvent.     Comp_Navigation.mxml     /uwth1/Components     line 28     Flex Problem


      How do i correct this please ?


      Many Thanks