If the code must be really called for each mouse move, then I have no
solutions . However if it is not crucial to execute all code for each
event, then perhaps you could add an incremental flag and execute code
for some of the events only, eg:

 events_count = 0
 ....
 MOUSE MOVE
 if((events_count++ % 5) == 0) { then execute code } else { wait next event }

To make sure that something is changed after user releases the screen,
then you can call code execution on mouse UP (if last count did not):

 MOUSE UP
 if(events_cout > 0 && (events_count % 5) != 0) { then execute code }

The bigger modulo (here 5), the more noticeable may be the
unresponsiveness to the user, but the faster refresh.

I know it is a brutal overcome.

g
 

Monday, February 01, 2010 (2:23:40 PM) Glen Pike wrote:

> Hi,

>     I am noticing a performance issue creeping into my application todo
> with mouse movement.

>     We have a touchscreen with custom sliders to control stuff via a few
> AS3 classes then an XML socket.

>     The sliders use a "thumb" which applies an MOUSE_MOVE listener to 
> the stage when the thumb receives a MOUSE_DOWN event and removes it when
> the stage / thumb gets a MOUSE_UP event.

>     If someone moves the slider quickly, over a period of time, the 
> screen update becomes more and more delayed and when you release the 
> slider. it bounces around for ages after you let go, the longer and 
> faster you move it for, the longer it takes to stop.

>     Now some of this bottleneck is due to the amount of code that gets
> called each mouse move, which I understand.  What I could do with does
> anyone have any tips or techniques for reducing the bottleneck or 
> handling the mouse movement events differently.

>     e.g.  Do I need to start looking at ENTER_FRAME or timer based 
> events, or something else.

>     From what I understand, FlashPlayer will handle the mouse events as
> the OS sends them - the problem is not apparent on Windows running dual
> Xeon 5150's, but deploying on an AMD Athlon Dual core 5000+ running 
> Gentoo + FP10 (10.0.32.18?) the FlashPlayer don't like it, no sirree.

>     TIA.

>     Glen


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to