2 Replies Latest reply on Feb 15, 2008 3:56 PM by Slistak2002

    Custom Event issue

    Slistak2002
      Hi all-

      I'm trying to create a simple custom event that gets bubbled up so that a parent container can receive it. When i set the event's bubblle to true, I get a run-time error that type coercion failed cause for some reason it's trying to convert the event to a mouse event. What am i doing wrong? Thanks!

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Canvas xmlns:mx=" http://www.adobe.com/2006/mxml" width="100%" height="100%" backgroundColor="white">
      <mx:VBox width="100%" height="100%" horizontalAlign="center" verticalAlign="middle">
      <mx:Image id="silhouette" source="pics/silhouette.jpg" click="silhouetteClicked()"/>
      <mx:Label id="label1" text="Click Image"/>

      </mx:VBox>
      <mx:Metadata>
      [Event(name="startEditEvent", type="flash.events.Event")]
      </mx:Metadata>

      <mx:Script>
      <![CDATA[


      private function silhouetteClicked():void
      {

      this.label1.text ="Clicked";
      dispatchEvent(new Event("startEditEvent",true));
      }
      ]]>
      </mx:Script>
      </mx:Canvas>