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
Post a Comment