Ok, I should have given a bit more background. I am trying to detect a CLICK anywhere on the (blank) stage.
Only when the user clicks somewhere on stage, I want to show something. How can I do this? Do I still need to draw something? Sajid On Mon, Aug 17, 2009 at 11:50 AM, Latcho<spamtha...@gmail.com> wrote: > Are you sure there is a graphic in the myGesture movieclip ? > You need something to click on. > Do you see the handcursor with buttonMode = true ? > Otherwise try this as a test in the MyGesture constructor asn make sure you > see a square, then check for handCursor, then click it. > Mind that the the square is a background graphic so children of MyGesture > can overlap > > this.buttonMode = true; > this.mouseEnabled = true; > this.mouseChildren = false; > this.graphics.beginFill(0xFF00FF,1); > this.graphics.drawRect(0, 0, 100, 100); > this.graphics.endFill(); > > > > Sajid Saiyed wrote: >> >> Hi Anna, >> Thanks. >> Forgot to mention that I tried MouseEvent as well and no luck :( >> >> Seems so strange.... >> I am sure I am missing something basic here. >> >> Sajid >> >> On Tue, Aug 18, 2009 at 11:23 AM, Anna<vean...@gmail.com> wrote: >> >>> >>> 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 >>> >>> >> >> _______________________________________________ >> Flashcoders mailing list >> Flashcoders@chattyfig.figleaf.com >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> >> > > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders