How can I add an additional property to an image added with display.newImage?

Hello,

So I have a list of images added dynamically to the scene and every image takes the user to a different scene. How can I add an additional property to the image that I added with display.newImage so I can tell from the event listener which image was clicked?

Thanks.

An table object, like the item returned from display.newImage can have any property added to it by simply giving the property a name and then assigning a value to it:

someObject.someKey = someValue

such as:

yourImage.name = “blueImage”

yourImage.id = 10

You can make up the key as long as its not something already in use and assign any appropriate value to it.

Rob

That’s very convenient. Thanks Rob.

An table object, like the item returned from display.newImage can have any property added to it by simply giving the property a name and then assigning a value to it:

someObject.someKey = someValue

such as:

yourImage.name = “blueImage”

yourImage.id = 10

You can make up the key as long as its not something already in use and assign any appropriate value to it.

Rob

That’s very convenient. Thanks Rob.