help for i in ... with a table

hi, i don’t know how animate every cells one after the other of a grid with a the fucntion for i in…

rects = {} for i = col, numCol do     rects[i] = {}     for k = row, numRow do          rects[i][k] = display.newRect(...)     end end --rect in row 1 column 5 transition.blink(rects[1][5], { time=1000 }) for i in rects\* do ???

Something like this:

[lua]

Local cnt = 1

for i = 1, #rects, 1 do

            for k = 1, #rects[i], 1 do

                        transition.blink(rects[i][k], { time=1000, delay = 50 * cnt })

                          cnt = cnt + 1       

                end

end

[/lua]

big thank you without buser you could tell me how it’s done the same thing but randomly

You mean you want the blink time to be random?

[lua]

local tm = math.random(500, 1500) – choose a blink frequency between 0.5 seconds and 1.5 seconds

transition.blink(rects[i][k], { time=tm})

[/lua]

no i would an random occurrence of transition for cells

with for i in i the transitions of the cells jump to position 1 to 100. I’d like that to happen randomly

This would randomly blink one of the rectangles. Simply call the code via a function to blink more than one on demand.

[lua]

local col = math.random(1,#rects)

local row = math.random(1,#rects[col])

transition.blink(rects[col][row], { time=1000})

[/lua]

I kinda tricked into issues but thanks to you I learned speed 2000.Encore a big thank you all;)

hi, Nick Sherman

I come back to you to know if it’s possible to do your code below except one cell 

local tm = math.random(500, 1500) transition.blink(rects[i][k], { time=tm})

transition.blink(rects[i][k], { time=tm}) --except for example rects[2][7]

Thanks for your help.

Something like this:

[lua]

Local cnt = 1

for i = 1, #rects, 1 do

            for k = 1, #rects[i], 1 do

                        transition.blink(rects[i][k], { time=1000, delay = 50 * cnt })

                          cnt = cnt + 1       

                end

end

[/lua]

big thank you without buser you could tell me how it’s done the same thing but randomly

You mean you want the blink time to be random?

[lua]

local tm = math.random(500, 1500) – choose a blink frequency between 0.5 seconds and 1.5 seconds

transition.blink(rects[i][k], { time=tm})

[/lua]

no i would an random occurrence of transition for cells

with for i in i the transitions of the cells jump to position 1 to 100. I’d like that to happen randomly

This would randomly blink one of the rectangles. Simply call the code via a function to blink more than one on demand.

[lua]

local col = math.random(1,#rects)

local row = math.random(1,#rects[col])

transition.blink(rects[col][row], { time=1000})

[/lua]

I kinda tricked into issues but thanks to you I learned speed 2000.Encore a big thank you all;)

hi, Nick Sherman

I come back to you to know if it’s possible to do your code below except one cell 

local tm = math.random(500, 1500) transition.blink(rects[i][k], { time=tm})

transition.blink(rects[i][k], { time=tm}) --except for example rects[2][7]

Thanks for your help.