4 pictures = 4 diferents sound

Member
Posts: 178
Joined: 2008.09
Post: #1
Hi.
i Need to make for my iphone 4 pictures of animals.
and when people touch a dog, .... sound like dog.
if touch a cat....sound like a cat.... etc....

i get this code from a nice tutorial:

- (void)touchesBegan: (NSSet *)touches withEvent: (UIEvent *)event {
[soundEffect play];


here say, every pixel of the screan is touched.... play a sound.
but ineed 4 pictures , and 4 diferents sound.

how can I do to say xCode to play a sound every time touch a picture please?

thanks a lot. !

my iphone website: http://www.elsalvadorguia.com
intel Imac 20", iphone 8GB (2G)
Quote this message in a reply
Moderator
Posts: 613
Joined: 2004.09
Post: #2
Personally I would make the images custom UIButtons and then link those to an action that played a sound.

Kyle Richter
DragonForged.com
Twitter: @kylerichter
Quote this message in a reply
Member
Posts: 178
Joined: 2008.09
Post: #3
kodex Wrote:Mad......UIButtons with action that played a sound.Mad

could you tellme please how add an action (play sound) to a UIButtons ?
please help.

thanks a lot !

my iphone website: http://www.elsalvadorguia.com
intel Imac 20", iphone 8GB (2G)
Quote this message in a reply
Moderator
Posts: 613
Joined: 2004.09
Post: #4
-(IBAction)playSound1
{
[sound1 play]
}

ect, then link them to the buttons in IB

Kyle Richter
DragonForged.com
Twitter: @kylerichter
Quote this message in a reply
Member
Posts: 178
Joined: 2008.09
Post: #5
to valuable for me. realy thank You !

my iphone website: http://www.elsalvadorguia.com
intel Imac 20", iphone 8GB (2G)
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Taking Pictures of Game State inside an app Bersaelor 7 5,185 Nov 3, 2009 05:07 AM
Last Post: Bersaelor
  [iPhone/OpenGL-ES] Loading/Drawing Pictures & Main Loop, where is it? jAuriya 6 6,608 Feb 2, 2009 10:12 AM
Last Post: longjumper
  zoom out is not working on pictures ! imaumac 0 1,663 Jan 5, 2009 10:41 AM
Last Post: imaumac