In an actor, is it possible to change what sound file is played using the Change Attribute action?
Is there any way to use a Change Attribute or similar action to change which sound is played back using a Play Sound action?
For example, with images, you can do this:
Change Attribute Self.Image To yourimagenamehere.png
Is there a way to achieve a similar functionality with playing back audio files?
Thanks in advance.
For example, with images, you can do this:
Change Attribute Self.Image To yourimagenamehere.png
Is there a way to achieve a similar functionality with playing back audio files?
Thanks in advance.

Comments
but, don't think so … the images are flat and just involve changes of one-time pixel colors … the sound/music is blocks of a series of notes that play sequentially.
images are actor's attributes and sounds aren't
some times I would like to be able to scream "Stop the Music!" …
someday this might be doable in GS …
@};- MH
Anyone else know a way?
feedback this to GS … maybe some future build will have sounds accessible from the ExpEditor … and we can then put our sounds in tables!
@};- MH
So say you want a sound to play when the player collides with whatver. You would have seperate rules when actor collides and selectedSound=1 play sound 1, another rule when actor collides and selectedSound=2 play sound 2, and so on. Then you can change the selectedSound attribute to change what sound plays
cheers
I've actually already been using variations on this method, I was hoping Tables would have made accessing sounds more flexible. I've got some loose ideas floating around my head that may work with tables, I'm going to see what I can build here.
You probably know about putting expressions/attributes in the Volume and Pitch aspects of the sound behaviors though by getting to the Expression Editor by clicking on their appropriate "e"s. Hope that's some sort of help.
PS As MH and others said there's no real shortcut for playing a different sound with a Behavior or attribute, I'm afraid; you'll have to do it the long way around:
When PlaySound = 1
Play Sound 01
When PlaySound = 2
Play Sound 02
etc.
----------------------------------------------
http://davidgriffinapps.co.uk/
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps