I am a total noob to programming and lua ( i don’t have a developer program subscription anywhere yet! ) and am currently just developing apps for fun. I don’t know if this has been posted elsewhere, but I am having trouble making a random image appear when someone clicks on an image. I have 10 images in the folder. Here is my code so far.
[lua]local background = display.newImage ( “white.png” )
background.y = 500
local text = display.newText ( “Tap item to change.”, 5, 60, native.systemFont, 45 )
text:setTextColor ( 255, 0, 0 )
local r = math.random ( 1, 10 )
local item = display.newImage ( “[r].png”, 90, 350 )
function item:tap (event)
local r = math.random ( 1, 10 )
local item = display.newImage ("[r].png", 90, 350)
media.playEventSound ( “coin.wav” )
end
item:addEventListener ( “tap”, item ) [import]uid: 16721 topic_id: 11705 reply_id: 311705[/import]

(Sorry, just have to keep a clean forum ;))