Re: Garbage Collection Concern

2013-10-12 Thread Peter Ginneberge
Houser jef...@dot-com-it.com Sent: Friday, October 11, 2013 5:23 PM Subject: Re: Garbage Collection Concern So - now, after attempting to add some event handlers here, I remember why I did what I did. How on earth do you dispatch events from itemrenderers, and successfully add handlers dynamically

Re: Garbage Collection Concern

2013-10-11 Thread Thomas Wright
So - now, after attempting to add some event handlers here, I remember why I did what I did. How on earth do you dispatch events from itemrenderers, and successfully add handlers dynamically to the view? First off, the mxml for the list is such that you merely indicate the class to be utilized as

Re: Garbage Collection Concern

2013-10-11 Thread João Fernandes
I think what Jeff proposed was something like this: someList.addEventListener(someCustomEventString,someHandler); and in your itemRenderer, you just dispatch dispatchEvent(new CustomEvent(CustomEventString),bubbles=true) No need to add and remove eventListeners based on the items created.

Re: Garbage Collection Concern

2013-10-11 Thread Lee Burrows
Hi, i dispatch from itemrenderers to parent list like this: (owner as List).dispatchEvent(myEvent); handling custom events with mxml is more complicated. you could listen for the list creation complete event (in mxml) and then add listeners for the itemrenderer events via AS3, eg: s:List

Re: Garbage Collection Concern

2013-10-11 Thread Thomas Wright
ok ok, I get what you guys are saying. Gotcha, thanks :) On Fri, Oct 11, 2013 at 9:45 AM, Lee Burrows subscripti...@leeburrows.comwrote: Hi, i dispatch from itemrenderers to parent list like this: (owner as List).dispatchEvent(myEvent); handling custom events with mxml is more

Re: Garbage Collection Concern

2013-10-11 Thread Peter Ent
I think bubbling the event is the easiest way to do it. This way you can catch the event where it makes the most sense to handle it. For example, you can add the event handler to the List (or DataGrid or whatever) which is up the display-list chain from the itemRenderer and have the function be

Garbage Collection Concern

2013-10-10 Thread Thomas Wright
I have a question about garbage collection in reference to a technique I've used on a fairly regular basis. Perhaps this is bad form, but this is what I've been doing nonetheless. So this is as close to what I've been doing as possible, let's consider a mobile app in my example of this method.

Re: Garbage Collection Concern

2013-10-10 Thread Jeffry Houser
On 10/10/2013 11:14 AM, Thomas Wright wrote: Second - is there a better way to handle this, or is this legit? From an encapsulation perspective, the renderer shouldn't know its parents. I always recommend dispatching an event, that bubbles from the renderer and then handling it in the

Re: Garbage Collection Concern

2013-10-10 Thread Thomas Wright
Ok, thanks. I can't remember why I even started doing this in the first place - honestly. I do remember having problems with dispatching an event in one particular circumstance, so I did this and didn't look back. Bad habits die hard I guess. Thanks for the response :) On Thu, Oct 10, 2013 at