I am making an application (in corona) that will show a image from a folder. There is 50 images in the folder, all name with "number.jpg" (1 to 50)
I am using currently this one to get the number
--populating table with 50 numbers (1-50)
for i =1,50 do
numbers[i] = i
end
--loop to generate 1 random number
for i = 1, 1 do
-- select random position from the table
local pos = math.random(1,#numbers)
local num = numbers[pos]
print(num)
--remove the number from table once it is selected
table.remove (numbers,table.indexOf(numbers, num))
end
How can i make this number, get out the numbered image? Not been using corona, but was thinking somthing like
myImage = display.newImage("/folder/", num, ".jpg")
But what do i know?
Hope you understand my question.
-- Eirik.