flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Kessler <kesslerconsult...@gmail.com>
Subject Re: [jira] [Assigned] (FLEX-33608) Add function "removeAllEventListener()"
Date Wed, 17 Jul 2013 01:16:09 GMT
Changing the flexsprite wasn't going to get everything.  It was just low
hanging fruit for a test/example since it allowed me a wide range of
components to test with.  If I could have changed the EventDispatcher it
would have been a better :P

I like the looping backwards idea for removing items... will keep me from
adjusting values as much.  I'll change over to that later.

I started using more getItemAt because not everything allows the brackets
anymore.  Not sure how much of a speed difference there is.

Thanks Justin


On Tue, Jul 16, 2013 at 8:41 PM, Justin Mclean <justin@classsoftware.com>wrote:

> Hi,
> >
> https://github.com/KesslerConsulting/example/commit/30ee4b96911d301ea09516324241c4bc9d734f16
> Very quick glance, but I think that removing items from a list when you're
> looping to the number of original items in the list can get you into
> trouble.
>  for (nLoopingIndex = 0; nLoopingIndex < nListenerTotal; nLoopingIndex++)
> It's best to loop backwards to avoid this issue. Like so:
>  for (nLoopingIndex = nListenerTotal -1 ; nLoopingIndex >= 0;
> nLoopingIndex--)
> I'd also use bracket notation rather than getItemAt but perhaps that's
> just me?
> You might also need to think about stage events and the like.
> Thanks,
> Justin

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message