Oops... I forgot that there is no 'target' setter to override, only a 'target' getter.
Two other possibilities... 1. If you know all the classes that might be dispatching the wrong event, have them override dispatchEvent(). 2. Put capture handlers on the SystemManager for these events and inspect their 'target' to see if it is appropriate. Gordon Smith Adobe Flex SDK Team ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald Sent: Thursday, August 21, 2008 8:11 PM To: [email protected] Subject: Re: [flexcoders] Can an event know when it is dispatched? You missed the original point, that there is no Event.as - it's part of Player. On Fri, Aug 22, 2008 at 12:47 PM, yigit <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: But u can public a super's protected. and that is the thing i mentioned in my post " I hope the underlying variable which keeps the reference to the target is protected, not private;" sorry, dont have the sdk to check now, so if the underlying variable (e.g. _target) is private, sorry for you. yigit Josh McDonald wrote: > That was just an example. You can't public a super's private variable, > nor can you read-write a super's read-only variable. > > -Josh > > On Fri, Aug 22, 2008 at 12:21 PM, yigit <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> >> wrote: > > I think gordon's point was not > e.target = this; > > you will implement your own Event class which will extend original > Event > class . > I hope the underlying variable which keeps the reference to the target > is protected, not private; > so you can edit that value from your subclass. > > yigit > > Josh McDonald wrote: > > Nope :( I get 1059: Property is read-only when compiling this: > > > > var e : Event = new Event(); > > e.target = this; > > > > -Josh > > > > On Fri, Aug 22, 2008 at 11:16 AM, Gordon Smith > <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> >>> wrote: > > > > You should be able to override the setter for 'target' in a > > subclass of Event. There should be nothing special about it; > it's > > just a public getter/setter. > > > > > > > > Gordon Smith > > > > Adobe Flex SDK Team > > > > > > > > > ------------------------------------------------------------------------ > > > > *From:* [email protected] <mailto:[email protected]> > <mailto:[email protected] <mailto:[email protected]> > > > <mailto:[email protected] <mailto:[email protected]> > <mailto:[email protected] <mailto:[email protected]> >> > > [mailto:[email protected] <mailto:[email protected]> > <mailto:[email protected] <mailto:[email protected]> > > > <mailto:[email protected] <mailto:[email protected]> > <mailto:[email protected] <mailto:[email protected]> >>] *On Behalf Of *Josh McDonald > > *Sent:* Thursday, August 21, 2008 5:44 PM > > *To:* [email protected] <mailto:[email protected]> > <mailto:[email protected] <mailto:[email protected]> > > <mailto:[email protected] <mailto:[email protected]> > <mailto:[email protected] <mailto:[email protected]> >> > > *Subject:* [flexcoders] Can an event know when it is dispatched? > > > > > > > > Hey guys, > > > > I want to know if there's a (nice, probably secret) way to > for an > > event to know when it's dispatched? I could hook into a timer or > > ENTER_FRAME and have it check for a valid target, but that's not > > very nice :) > > > > I haven't overloaded function set target, but I imagine that'll > > give me either a compile-time error or a verifier error since > > Event is Player-native, and I don't know what namespace to > put it > > in to begin with. I know about the mx_internal static hook in > > UIComponent, but I want to catch certain events being dispatched > > from non-visual components and complain about it (just to make > > life easier for developers using my framework). > > > > Cheers, > > -Josh > > > > -- > > "Therefore, send not to know For whom the bell tolls. It > tolls for > > thee." > > > > :: Josh 'G-Funk' McDonald > > :: 0437 221 380 :: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> >> > > > > > > > > > > -- > > "Therefore, send not to know For whom the bell tolls. It tolls > for thee." > > > > :: Josh 'G-Funk' McDonald > > :: 0437 221 380 :: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> >> > > > > > ------------------------------------ > > -- > Flexcoders Mailing List > FAQ: > http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt <http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt> > <http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt <http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt> > > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo <http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo> > <http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo <http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo> >! > Groups Links > > > (Yahoo! ID required) > > mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > > > > > > > -- > "Therefore, send not to know For whom the bell tolls. It tolls for thee." > > :: Josh 'G-Funk' McDonald > :: 0437 221 380 :: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > ------------------------------------ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt <http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo <http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo> ! Groups Links (Yahoo! ID required) mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> -- "Therefore, send not to know For whom the bell tolls. It tolls for thee." :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>

