Changing an image - best practise

Hello,

I am looking for some guidance please.

I am writing a simple app that plays 12 different sounds.

I have 12 different images that corresponds to the 12 different sounds.

When the user taps on one image I want the image to change (to indicate that it is the current selection) and then the sound plays on loop.

When the user taps on a second image I want the original image to return to the default image and then the second tapped image to change (to indicate that it is the current selection) and so on.

I am at a loss. I can do this with tons of code, but I am sure there is an easier way, but I am not sure which direction to take.

Any help would be appreciated.

Christine

[import]uid: 133106 topic_id: 26392 reply_id: 326392[/import]

I would say that you want to create a function which contains all the logic for a single image/button. It should call a global function which sets all images back to normal and sets the touched image to its alternate version. The switching of the image can be done using transition.to for a nice fade.

Write out the logic you want in simple pseudo-code and then try coding it. You’ll find it more straightforward. [import]uid: 8271 topic_id: 26392 reply_id: 107025[/import]

The Easiest way would be to use an image Sheets. One image 12 frames. [import]uid: 7177 topic_id: 26392 reply_id: 107121[/import]