Hi sorry to trouble all dear.
I hv a seriers button , same as button class iin cargobot, i put them in a table ,wchich is button24
I init each button and insert them into button by order. In. For…in ipair …
Also i sprite the button img for each button in draw. Until now ,all can work well.
Also there is a single button named buttonA,not belong to the table above .
In bottom, function touched(t)
I pass t to buttonA by: buttonA:touched(t)
In draw i make its function: buttonA:onBegan =function(buttonA,t)
This button can work well .
Also in touched(t)
I do :
For i,v in ipair(button24)
button24[i]:touched(t) end. ( I don’t know the problem is fm here or the following…)
In draw, i do:
For i,v in ipair(button24)
button24[i].onBegan = function(button24[i],t) ???
sound(asoundhere in pack) end
Red error always show the line number on the line with ???
Where am i wrong? Or cannot pass t to the button in table ? Or how to pass in ???
Thanks a lot.