On Mon, Aug 17, 2009 at 9:32 PM, Sajid Saiyed <sajid.fl...@gmail.com> wrote:
> Hi, > Although a bit late, I am making a move to AS3 and facing some issues. > After banging my head around a bit, I would like to ask for some help :) > > My CLICK event is not getting detected from withing my class file. > > In the code snippets below, the "reportClick" function is not getting > triggered when I click my mouse in stage. > > Here is how the files are setup: > > ****** MyGesture.as > > package Gestures > { > import flash.display.*; > import flash.events.*; > import flash.filters.*; > ........ > > public class MyGesture extends MovieClip > { > ........ > > public function MyGesture(){ > ........ > > addEventListener(MouseEvent.CLICK, reportClick); > ........ > } > ........ > > function reportClick(e:Event) > { > trace("reportClick"); > //dispatchEvent(new Event(MyGesture.clickOK)); > } > } > } > > //////////////////////////////////////// > > Can someone tell me what I am doing wrong? > > Sajid, Try changing "function reportClick(e:Event)" to "function reportClick(e:MouseEvent)" In my understanding, AS3 treats Event and MouseEvent differently. Hopefully, this helps. Regards, Anna _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders