Hi all,
I am looking for Function Array in Corona SDK.Is it possible to write “Function Array” in Corona like this,
Sticker[CountSticker] = display.newImageRect(stickerImagePath,160, 136) Sticker[CountSticker].x = displayOffsetX(120 ,offsetx) Sticker[CountSticker].y = displayOffsetY(100,offsety1,offsety2) Sticker[CountSticker].xScale = Xa Sticker[CountSticker].yScale = Ya function Sticker[CountSticker]:touch( event ) if event.phase == "began" then self.markX = self.x -- store x location of object self.markY = self.y -- store y location of object elseif event.phase == "moved" then local x = (event.x - event.xStart) + self.markX local y = (event.y - event.yStart) + self.markY self.x, self.y = x, y if event.y \> 700 then self.y = 650 end if event.x \<15 then self.x = 20 end if event.x \> 1020 then self.x = 1000 end stickerXPos = self.x stickerYPos = self.y for row in db:nrows([[SELECT UserID FROM lastloginlog ;]]) do userID = row.UserID end end return true end Sticker[CountSticker]:addEventListener( "touch", Sticker[CountSticker] )