Search the web
Sign In
New User? Sign Up
flexcoders · RIA Development with Adobe Flex
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Am I the only one who wishes EventDispatcher exposed its listeners?   Topic List   < Prev Topic  |  Next Topic >
Reply | Forward < Prev Message  | 
Sometimes it would be really nice be able to access a list of
currently attached listeners by doing something like
myButton.listeners. Having that return a collection of objects that
expose the event type and handler method would be nice and it doesn't
seem like it would be that hard to implement since they're obviously
already kept track of somewhere.

Does anybody else wish this was provided? Does anyone from Adobe have
info on why its not and/or if it might be someday?

Thanks,
Ben




Wed Nov 28, 2007 2:04 pm

ben.clinkinb...
Offline Offline
Send Email Send Email

Forward
< Prev Message  | 
Expand Messages Author Sort by Date

Sometimes it would be really nice be able to access a list of currently attached listeners by doing something like myButton.listeners. Having that return a...
ben.clinkinbeard
ben.clinkinb...
Offline Send Email
Nov 28, 2007
2:04 pm

I can see this functionality being useful for various reasons. Ben, are you thinking you want to track down any listeners that are left over that are ...
Doug McCune
dougmccune
Offline Send Email
Nov 28, 2007
2:14 pm

.NET does this and it comes in handy (although usually in situations that would not apply in Flex, such as threading and switching contexts). I agree that if...
Samuel R. Neff
sam_atellis
Offline Send Email
Nov 28, 2007
2:34 pm

That wasn't specifically my thinking but that seems like it would be a super useful benefit of having that info available. I honestly can't remember every...
ben.clinkinbeard
ben.clinkinb...
Offline Send Email
Nov 28, 2007
2:58 pm

... Ugh, I guess we can't since the source isn't available....
ben.clinkinbeard
ben.clinkinb...
Offline Send Email
Nov 28, 2007
3:08 pm

you can create your own class like TransparentEventDispatcher which implements IEventDispatcher and internally contains an EventDispatcher object and maintains...
Samuel R. Neff
sam_atellis
Offline Send Email
Nov 28, 2007
5:27 pm

you can maybe add a hook to dispatchEvent in UIComponent? http://www.darronschall.com/weblog/archives/000273.cfm DK ... -- Douglas Knudsen ...
Douglas Knudsen
dtk_atl
Offline Send Email
Nov 28, 2007
5:37 pm

You would monkey-patch UIComponent adding overrides of addEventListener and keeping a collection there. ________________________________ From:...
Alex Harui
alex_harui
Offline Send Email
Nov 28, 2007
5:43 pm

Ben may not have been, but I always have been thinking of this. It would be handy in debugging memory issues for one thing, and also a bit quicker (and surer,...
Jim Hayes
jim80hayes
Offline Send Email
Nov 28, 2007
2:59 pm

... someday? The Player's EventDispatcher class doesn't provide this capability, probably because it isn't part of the Document Object Model Level 3 Events...
Gordon Smith
gsmithsf
Online Now Send Email
Nov 28, 2007
7:33 pm

Why in subclasses and not EventDispatcher itself? Ben...
ben.clinkinbeard
ben.clinkinb...
Offline Send Email
Nov 28, 2007
8:34 pm

That would make sense, but it would be up to the Player team since EventDispatcher is a Player class. The Flex team can lobby the Player team for new features,...
Gordon Smith
gsmithsf
Online Now Send Email
Nov 28, 2007
9:27 pm

Gotcha. Maybe you should try sending cookies along with the request, I've heard it works well on the Flex team. :)...
ben.clinkinbeard
ben.clinkinb...
Offline Send Email
Nov 29, 2007
12:26 am

Just FYI, I posted an example of monkey patching FlexSprite to get this functionality: ...
Doug McCune
dougmccune
Offline Send Email
Feb 21, 2008
7:19 pm

is that a bug or something in the way Flex works... I've been thinking about this sort of feature for a long time... If I knew about it before ( assuming it's...
Jerome Clarke
sinatosk
Offline Send Email
Feb 21, 2008
8:08 pm

It's a "feature" of the flex compiler, which will take the newest version of any of the classes that it finds and use that version in the final app. So when...
Doug McCune
dougmccune
Offline Send Email
Feb 21, 2008
8:15 pm

yeah... that was my first thought just after I posted... just how Quake 3 works... same file name and path but newer file time stamp :p just never heard of the...
Jerome Clarke
sinatosk
Offline Send Email
Feb 21, 2008
8:47 pm

I'm surprised that this thing works (i mean monkey patching). I think It's the worst case of code coupling. The use with event listeners is rare case when this...
andrii_olefirenko
andrii_olefi...
Offline Send Email
Feb 22, 2008
7:38 am

Is this utility broken by move to F3?...
juststeve
Offline Send Email
Mar 18, 2008
11:28 pm

Any chance that we can change the name to "Funky Monkey Patching?" Rick Winscot From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf...
Rick Winscot
rwinscot
Offline Send Email
Mar 19, 2008
12:30 am

If you want this functionality vote for it here: https://bugs.adobe.com/jira/browse/SDK-13763...
ben.clinkinbeard
ben.clinkinb...
Offline Send Email
Nov 28, 2007
8:49 pm

Funky's fine with me fwiw, but seriously...it's not surprising if this (fm) patch breaks under F3 but the general technique seems to valuable not to have some...
juststeve
Offline Send Email
Mar 19, 2008
10:25 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help