In this link, "do" method example code has a bug.button should be in for loop.or don't need button layer.Is it right?
The code is correct, albeit a bit non-sensical. What it demonstrates is how to use a single button to set the color for all of the layers created in the loop. The button under the first layer in the loop though, which makes it confusing. I’ll adapt it, thanks for reporting!