best practice: Access two pictures from two different scenes

Dear forum members,

unfortunately I still have no clue on how to solve my problem listed here:

https://forums.coronalabs.com/topic/66795-passing-displayobjects-between-scenes-works-until-object-reloaded/

therefor I would like to ask the other way round:

What is the best practice to (re)save pictures taken from camera (or library) in scene A and access them in scene B? To be more precise: In scene A I would like to “store” a new picture in either “storeplace A” or “storeplace B”, depending on which event.params I get. Scene B shows both pictures, if they are already set, or a template picture thats in the same folder as my lua files.

So, at the beginning scene B shows two template pictures. If I go to scene A and chose a first new picture, scene B has to display that new picture plus the second template picture. If I go again to scene A and chose a new second picture and go back to scene B, it has to display the two new pictures. If, again, I go to scene A, I can retake a picture and - of course - display that retaken picture in scene B.

I tried to use a separate lua file to store the two pictures without success. Now I used composer.setVariable() and composer.getVariable(), but again, the same error occurs: I can update the first taken picture as often as I want in scene A and access it in scene B, but as soon as I take the second picture and display it in scene B, the first image disappears.

Any ideas? Thank you very much!

I’m not sure we understand the problem.

Where does the picture originate? Are you using media.capturePhoto()/media.selectPhoto() or are you using display.save()/display.capture() to make a new image from your screen?

You should be able to save the images to one of your sandbox directories (system.DocumentsDirectory, system.CachesDirectory, system.TemporaryDirectory) and then you can use display.newImage() to load them in to scene B.

Rob

// edit: Forget the following answer: It contains an error that I just fixed and that unfortunately is not the real problem. Sorry, just ignor this reply!

I’m not sure we understand the problem.

Where does the picture originate? Are you using media.capturePhoto()/media.selectPhoto() or are you using display.save()/display.capture() to make a new image from your screen?

You should be able to save the images to one of your sandbox directories (system.DocumentsDirectory, system.CachesDirectory, system.TemporaryDirectory) and then you can use display.newImage() to load them in to scene B.

Rob

// edit: Forget the following answer: It contains an error that I just fixed and that unfortunately is not the real problem. Sorry, just ignor this reply!