Sound and music problem!!!!
applecrayzy
Member, PRO Posts: 6
Hi guyz, i am busy creating an app for kids. On screen will be a few actors. If an actor is touched, play sound or music works fine. My problem is, i need instructions from you guyz on how to play the next actors sound(by touching actor), and stop the previous actor's sound/music.
I followed Tshirtbooth youtube example on WORKING WITH SOUND, but it doesnt answer my problem.
To give you a clearer example. If for instance you have 15 actors on screen which is actually an Music CD. To play track 1 is eazy, cos i just touch Track 1 actor and it plays. If i'm fed up of Track 1 and wanna listen to Track 5 for example, i just wanna touch Track 5 actor, and it must play and automatically stop Track 1.
Please help, with instructions. If you can make a video clip and publish to youtube, that will much appreciated.
I followed Tshirtbooth youtube example on WORKING WITH SOUND, but it doesnt answer my problem.
To give you a clearer example. If for instance you have 15 actors on screen which is actually an Music CD. To play track 1 is eazy, cos i just touch Track 1 actor and it plays. If i'm fed up of Track 1 and wanna listen to Track 5 for example, i just wanna touch Track 5 actor, and it must play and automatically stop Track 1.
Please help, with instructions. If you can make a video clip and publish to youtube, that will much appreciated.
Comments
as far as i know, music files can only be played one at a time, sound files can overlap
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
UptiMistik, big round of applause =D> to you. :x I'm so happy now, i dont wanna go sleep and its 05h36 in my part of the world. Hope this app brings joy to alotta kidz, thanx to you guyz.
1. A game index attribute named "musicTrack".
2. A single "music player" prototype actor with the following rule/s:
If musicTrack = 1, play "selected music file 1"
if musicTrack = 2, play "selected music file 2"
and so on...
3. So now, just throw this in the change track actors:
(In track 1 actor) If touch pressed, change musicTrack to 1
(In track 2 actor) If touch pressed, change musicTrack to 2
(In next track actor) If touch pressed, change musicTrack to musicTrack + 1
This is using the idea of separating global behaviors out of individual actors. This makes things easy to edit, offers better performance and reduces bugs.