(Since several folks have asked about essentially the same problem for
Process List and
Build List, I'm posting this question+answer as a reference. If you're having trouble with
Process List and
Build List, make sure you understand "Tip: How to use the Process List node" in http://vuo.org/node/870 and this question+answer.)
This composition with a
Process List works as expected. It shows a row of rainbow-colored spheres.
But when I add mouse interaction, something's not right. When I move the mouse, some of the spheres (esp. on the ends of the row) flicker with the wrong color. It looks like the list output by the
Process List node's Processed List port is out of order or has repeated items.
Process List node's Processed Item input port needs to receive exactly as many events as the Process Item port fired. Too few, and the Processed List port won't fire. Too many, and the Processed List port will fire a list containing unintended items.
In the composition above, the problem is too many events hitting the Processed Item input port. The extra events are coming from the
Receive Mouse Moves node.
To fix the problem, insert a
Hold Value node, as in the composition below. The
Hold Value node's New Value port blocks events (it has a wall), so the events from
Receive Mouse Moves no longer go through
Make HSL Color and
Make Sphere to hit the
Process List node's Processed Item port. The
Hold Value node's refresh port allows events through, so the event from the
Process List node's Process Item port can grab the value stored in
Hold Value and pass it along to
Make HSL Color. (If you're not familiar with the terms or concepts in this paragraph, see the Vuo Manual under the Vuo Editor's Help menu.)
In general, there are several ways to troubleshoot problems with
Build List and events. One is just to look carefully at your composition and see if there are any extra cables going into the
Build List node's feedback loop; if so, do they all have
Hold Value or other event-blocking nodes? Another strategy is to temporarily disconnect all cables into the
Build List node's Fire port, turn on the Show Events button in the toolbar, and run the composition; do any nodes in the feedback loop light up?