Efficient event listening in ActionScript 3 -


i have map of items , need know when mouse moves on item. should add event listener mouse on , mouse out each item (there may lot) or should add mouse on , mouse out listeners whole container , checking detect whether target has item on or not?

in second way mean event occur on entering each map tile in container listening. seems bit pointless, heard somewhere should add little possible.. should do?

well matter of preference. not performance issue in case. however, in event.enter_frame listener, should careful writing scripts executed per frame.

i think should add mouse-listner item mentioned above. listener attached object/item, removed when item or object deleted garbage collector.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -