button makes a random sounds

salah.rahalsalah.rahal Member Posts: 121
hello
could any one shows me how to make a button that playes random sounds every touche
thanks gs members

Comments

  • StusAppsStusApps Member, PRO Posts: 1,352
    When touch is pressed:
    Play sound random(1,10)..".ogg"

    Rename your sound file names to 1.ogg, 2.ogg, etc..
  • salah.rahalsalah.rahal Member Posts: 121
    StusApps
    thans man
  • StusAppsStusApps Member, PRO Posts: 1,352
    Actually that relies on the expression editor being available on the play sound attribute, not sure if it is. Am not near a computer to check
  • calvin9403calvin9403 Member Posts: 3,186
    Or maybe this:
    Make an attribute integer ,set it to 0
    Random(1,10)
    When attribute is 1 play sound .....
    When attribute is 2 play sound......
    Etc
  • StusAppsStusApps Member, PRO Posts: 1,352
    just checked, no expression editor. You'll have to do it the long way.
  • calvin9403calvin9403 Member Posts: 3,186
    StusApps said:
    just checked, no expression editor. You'll have to do it the long way.

    you mean the way I post?
  • StusAppsStusApps Member, PRO Posts: 1,352
    calvin9403 said:
    you mean the way I post?

    Yeah, can't think of a more efficient way at the moment.
  • calvin9403calvin9403 Member Posts: 3,186
    StusApps said:
    Yeah, can't think of a more efficient way at the moment.

    I think that is the best way too
Sign In or Register to comment.