[Flashcoders] MouseMove - performance issues
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 Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] MouseMove - performance issues
Not sure if an Event.Enter_Frame would be much different. Its worth a try though. Does the code have to run realtime with the slider being moved? Or can you call all the functions you need when you release the slider? --Original Message-- From: Glen Pike Sender: flashcoders-boun...@chattyfig.figleaf.com To: Flash Coders List ReplyTo: Flash Coders List Subject: [Flashcoders] MouseMove - performance issues Sent: Feb 1, 2010 7:23 AM 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 Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Nathan Mynarcik Interactive Web Developer nat...@mynarcik.com 254.749.2525 www.mynarcik.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] MouseMove - performance issues
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 Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] MouseMove - performance issues
Hi, Code has to run realtime ideally - the thing being controlled has to follow the onscreen as it's a "kiosk" type application. Glen Nathan Mynarcik wrote: Not sure if an Event.Enter_Frame would be much different. Its worth a try though. Does the code have to run realtime with the slider being moved? Or can you call all the functions you need when you release the slider? --Original Message-- From: Glen Pike Sender: flashcoders-boun...@chattyfig.figleaf.com To: Flash Coders List ReplyTo: Flash Coders List Subject: [Flashcoders] MouseMove - performance issues Sent: Feb 1, 2010 7:23 AM 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 Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Nathan Mynarcik Interactive Web Developer nat...@mynarcik.com 254.749.2525 www.mynarcik.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] MouseMove - performance issues
Hi Glen, are you using the updateAfterEvent method in your mouse move handler? private function mouseMoveHandler(event:MouseEvent):void { trace("mouseMoveHandler"); event.updateAfterEvent(); } http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/events/MouseEvent.html#updateAfterEvent%28%29 otherwise i'd try a timer, i had to do this recently with some 3d stuff where startDrag refuses to work when something was rendered as 3d and using a timer was a good alternative. hope this helps some, Dunc Message: 18 Date: Mon, 01 Feb 2010 13:23:40 + From: Glen Pike Subject: [Flashcoders] MouseMove - performance issues To: Flash Coders List Message-ID: <4b66d5dc.6080...@engineeredarts.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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 Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders