[Resolved] Picking a specific sprite frame for interactivity

I am working on a “Patty Cake” game and would like to add interactivity to only the sprite frame in which the character on screen has it’s Hand…Paw…etc in certain postition i.e. fully extented so that the child may tap it and get a response.

Any help would be greatly appreciated! :slight_smile:

Thanks! [import]uid: 75459 topic_id: 22985 reply_id: 322985[/import]

Although you can’t add a listener to just one frame you can do a check in the function. Eg;

[lua]local function highFive (event)
if event.target.currentFrame == 5 then --assuming the correct frame is #5
print “High five!”
end
end
mySprite:addEventListener(“tap”, highFive)[/lua]

Does this help?

Peach :slight_smile: [import]uid: 52491 topic_id: 22985 reply_id: 91872[/import]

Thanks Peach!!!

I will definitely try this when I get home! :slight_smile:

I really do appreciate it!

The Corona community is the BEST!!! [import]uid: 75459 topic_id: 22985 reply_id: 91963[/import]

No worries Jeff :slight_smile:

Check it out and if you have problems let me know, can definitely help you get this working.

Viva Corona!

Peach :slight_smile: [import]uid: 52491 topic_id: 22985 reply_id: 92120[/import]

Thanks again Peach!

I’ve been super swamped! I am still poking around with it…and will probably have to take you up on your offer.

Viva Corona!!! [import]uid: 75459 topic_id: 22985 reply_id: 93876[/import]