Stop the Sounds

dynamobytedynamobyte Member Posts: 1
HEllo There i'm noob in Gamesalad World! ^__^

I need to play multiple sounds (for this reason i use "sounds" and not "music" object)

in my app i need to stop them touching the same buttons that i use to start these sounds.

For Example: clicking on Actor1 it plays sound named "sound1"
While clicking on Actor 2 plays "sound 2" etc etc

Re-touching the same actors i want to stop music

How can i do this?

Comments

  • forkliftforklift Member Posts: 386
    I would use a boolean attribute for each actor. In this case, I'll call it self.sound. Start it being false.

    Rule To Turn Sound ON:
    Set up a rule that will run when ALL (conditions) are true.
    -(When actor 1 is touched)
    -(self.sound = false)
    --change attribute self.sound to true

    Rule To Turn Sound OFF:
    Set up a rule that will run when ALL (conditions) are true.
    -(When actor 1 is touched)
    -(self.sound = true)
    --change attribute self.sound to false

    Rule to play the sound:
    When self.sound = true, play sound
Sign In or Register to comment.