Hi Rob, I was able to get it working by doing the following, it seems to work ok for swapping two images, any thoughts?:
local function onTap( event )
if event.target then
t=event.target
playerwithfocus = t.index
print ("player “… playerwithfocus … " was tapped”)
if placeflag == true then
– save player info and then remove image from table
tempw = team[t.index].width
temph = team[t.index].height
tempx = team[t.index].x
tempy = team[t.index].y
team[t.index]:removeSelf()
– add other image back into table at correct index
local object = display.newImage(playerImage,showimage)
object.objTable = team
object.index = t.index
object.myName = object.index
object.objTable[object.index] = object
object.width = tempw --team[t.index].width
object.height = temph – team[t.index].height
object.x = tempx --team[t.index].x
object.y = tempy --team[t.index].y
object:addEventListener( “touch”, onTouch )
object:addEventListener( “tap”, onTap )
end
end
return true
end