Building the name of an object on the fly

Hi, I am new to Corona and am trying to access an image and would like to be able to build it’s name on the fly. I have tried os.execute but that seems to not recongnize the object name giving me an error. Please help. The syntax I have used is rather simple. I have images called page_1, page_2, page_3 … I want to be able to change the .x coordinates of those by doing something like

os.execute(“transition.to( page_”…nPageNo…", { time=2000, x=page_"…nPageNo…".x - 480 } )")

where nPageNo is is number between 0 and 10.

can this be done? Please help. [import]uid: 97768 topic_id: 16454 reply_id: 316454[/import]

os.execute is like dropping to the shell and executing a command.

If you want to have a transition, you do not need to use os.execute, just the transition.to({…})

The problem is that people think of dynamic variables too literally, have a read of this article here

think a bit differently, instead of a variable, think of an array, that way you can do exactly what you are after.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 16454 reply_id: 61408[/import]

Thank you JayantV,
I have put my objects in an array and it now works like a charm. [import]uid: 97768 topic_id: 16454 reply_id: 61554[/import]