Script for Epitrochoid, Slider flicker

 From:  Michael Gibson
6158.2 In reply to 6158.1 
Hi Brian, for your question #2:

> The second script attached is EpitrochoidSliderBadFlicker, with the code in the .js file.
> The "onmousemove" slider is causing bad flicker. Is there any way to fix this?

It looks like the UI events that are fired on each mouse move get stacked up. You should be able to avoid the flickering by keeping track of what the last used value was and don't do any update if the current retrieved value has not changed.

I've attached an updated version of the .js file that does this, it should help to reduce flicker. There will still be some flicker though because it takes a while for the script to assemble the points since it will end up doing a couple of inter-process communications for each of the 200 points that are created and it's not easy to interrupt an ongoing calculation when a new one is supposed to be starting. That's what the whole async factory mechanism helps with but it's not possible to do an async factory in script right now, it's part of the C++ side of the toolkit.

Right now things are just not really optimized for this kind of looping and more involved calculation only directly in a script...

- Michael
Attachments: