display a new image each time. when tapping the same button.

Good evening all knowing forums. Is it possible to have a new image display each time the same button is tapped. I have a set of images.

Thanks
Jeremy

[import]uid: 127028 topic_id: 23835 reply_id: 323835[/import]

Hello,

If I were you, I would use a movieclip like this:

[lua]local rankDisplay= movieclip.newAnim({
imagesPathRanks…“rank1.png”,
imagesPathRanks…“rank2.png”,
imagesPathRanks…“rank3.png”,
imagesPathRanks…“rank4.png”,
imagesPathRanks…“rank5.png”,
imagesPathRanks…“rank6.png”,
imagesPathRanks…“rank7.png”,
imagesPathRanks…“rank8.png”,
imagesPathRanks…“rank9.png”,
imagesPathRanks…“rank10.png”}
, 125, 125 )
local rank = 1

local function rankButton (event)

local phase = event.phase

if phase == “release” then

rank = rank + 1
if rank>10 then rank = 1

rankDisplay:stopAtFrame(rank)

end

end[/lua]

Please note that the code above has not been tested as is (but i am using something similar in my app)

Do not forget to “include” the movieclip module.

Good luck!

Mo
[import]uid: 49236 topic_id: 23835 reply_id: 95953[/import]