Note that there are some explanatory texts on larger screens.

plurals
  1. POActionscript 3 for Android - should I attach mouse event listeners to the stage or to individual sprites?
    primarykey
    data
    text
    <p>In AS3 on Android is it bad from a performance perspective to attach mouse event listeners to individual sprites rather than to the stage?</p> <p>I am writing an app for an Android phone using AS3 in Flash Builder. The app has multiple screens that respond to user touch. The screens are arranged in a hierarchy and show list data so that when you click on an item in a list you are presented with a new screen with a new sub list on it.</p> <p>I have been using an event listener to detect mouse / touch input and based on something I read that indicated that performance is much better if you keep the number of objects you are listening to to a minimum I have attached the mouse listeners from each screen to the stage object.</p> <p>This all works fine but I am finding that as I move between screens (and they get popped or pushed onto the dislay stack) I have to keep track of alot of adding and removing listeners to the stage object. If I don't then windows higher up the hierarchy than the current screen keep receiving mouse events.</p> <p>If I used listeners attached to sprites in each window then when the window was removed from the display even though it is kept in memory (ready to be popped back when a child window is closed) it won't receive any mouse events....</p> <p>Performance doesn't seem to be impacted using listeners directly on sprites when using my HTC phone to test with, however I obviously don't know what it will be like on other phones. Does anyone have any experience either way or a view on the best approach?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload