One approach is to register all rectangles with a controller object.
It runs the timer and on timeout gets the positions from the registered objects and updates the color.
Another approach is to have a model that gets the number of rectangles as its input and generates as many reference objects.
Each such object has a read/write for the position and a read property for the color.
The retangles are then generated using a Repeater, bind their position and color to the given reference object.
The model then updates each reference object with a timer.
Cheers,
_





Reply With Quote
Bookmarks