Passing display method by table, is it possible?

I want to be able to create a table with parameters that are later applied to a display object. Something like so:

[lua]local image = display.newImage( “image.png” )
local params = { xScale = 0.5, yScale = 1.3 }

for i, p in pairs( params ) do
image.i = p
end[/lua]

However the above code doesn’t work. Does anybody know how to get this working, or a similar solution?

Thanks! [import]uid: 43714 topic_id: 10587 reply_id: 310587[/import]

Try changing line 5 to this:

image[i] = p [import]uid: 5833 topic_id: 10587 reply_id: 38510[/import]

thanks, it works! [import]uid: 43714 topic_id: 10587 reply_id: 38511[/import]

No problem, glad I could help. [import]uid: 5833 topic_id: 10587 reply_id: 38512[/import]