Hi,
basicly, I have layouted in gumbo two scenes managed by storyboard which look the same.
in main.lua the image files are copied to the system documents.
scene1.lua and scene2.lua are like:
local dispObj\_1 = display.newImageRect( "image\_a.png", system.DocumentsDirectory, 300, 300 )
dispObj\_1.x = 180
dispObj\_1.y = 180
local dispObj\_2 = display.newImageRect( "image\_b.png", system.DocumentsDirectory, 300, 300 )
dispObj\_2.x = 510
dispObj\_2.y = 180
local dispObj\_3 = display.newImageRect( "image\_c.png", system.DocumentsDirectory, 300, 300 )
dispObj\_3.x = 840
dispObj\_3.y = 180
local dispObj\_4 = display.newImageRect( "image\_d.png", system.DocumentsDirectory, 300, 300 )
dispObj\_4.x = 180
dispObj\_4.y = 520
local dispObj\_5 = display.newImageRect( "image\_e.png", system.DocumentsDirectory, 300, 300 )
dispObj\_5.x = 510
dispObj\_5.y = 520
local dispObj\_6 = display.newImageRect( "image\_f.png", system.DocumentsDirectory, 300, 300 )
dispObj\_6.x = 840
dispObj\_6.y = 520
local button = display.newImageRect( "button.png", 20, 20)
button.x = 1010
button.y = 384
Now when the user touches one image on scene2.lua (lets say image_a), he should be taken to his photo-album, choose another image and image_a should be replaced by that new image like so:
local filePath = {baseDir = system.DocumentsDirectory, filename = "image\_a.png"}
local function touchDispObj\_1(event)
if event.phase == "began" and dispObj\_1Touch == true then
media.show(media.Camera, touchDispObj\_1, filePath)
end
end
In the api docs I read that this won’t work, because corona still reads “old” image_a from some cache. So how can I handle the new user chosen images? Save it as image_a1++? [import]uid: 103773 topic_id: 22268 reply_id: 88818[/import]