I get this error when inserting a tile to a group:
Runtime error
... (<the location of the lua file>)/main.lua:122: bad argument #-2 to 'insert' (Proxy expected, got nil)<br>stack traceback:<br> [C]: ?<br> [C]: in function 'insert'<br>
And here’s the code
Earlier on main.lua:<br>local tileGroup = display.newGroup()<br><br>...<br>
In an event listener:<br>local onMapClick = function( event )<br><br> ...<br><br> --Working and tile is defined<br> local tile = getTileFromScreen(startGridPos)<br><br> ...<br> if event.phase == 'began' then<br> <br> if tile then<br> tile:setImage(1)<br> tileGroup:insert(tile)<br> end<br> end<br><br> ....<br><br>end<br><br>Runtime:addEventListener("touch", onMapClick);<br><br>
Appreciate any help [import]uid: 109816 topic_id: 19248 reply_id: 319248[/import]