Memory overwrite problem in java script?

I have a script in part of my code and am seeing some very strange behavior.

In the Start() routine I obtain a reference to an object named “MenuBar”.

In the Update() routine I check for screen touches and if they touch the screen I do a MenuBarObject.audio.Play() call. I do this same call for three different areas they can click on the bar.

The strange part is that it plays different sounds even though I am calling audio.Play() on the same object…Apparently somewhere in the system it is overwriting the space where sounds are kept since the sound attached to the object changes.

Also, if I add any “yield” statements to the script, no matter where, Time stops working.

Any idea on this wierdness?

Can you guarantee that you don’t replace the audio anywhere and that you correctly stop the audio before replaying the new one?

Is the alternative audio you hear a different audio file on the system or something “random”?

Are you sure you wanted .play not the one shot play for audio?