It's not attempting to play if the variable is -1, it attempting if it's NOT -1. In other words, if the variable was set to the UID above, then it should play.
Also I can't use an else event here, remember this is stripped-down code and the reason I'm using this approach is that I need to work with the newly created object later on, but C2 won't allow that until you go back to a top-level event. This is a major problem I'm having regularly with C2. You need to either manipulate the object immediately inside the event-chain it was created in, or go back to a top-level event. So in this case, I'm storing the UID, then going to a top-level event and if the global variable has a UID stored instead of -1 it should play the sound.
That's the code exactly as I'm running it, when I click the button, the variable is set to the new UID, meaning the sound should play in the next block, but it doesn't.
I'll take a look into triggers, but I should point out that I'm aware that the code above isn't the best approach. I'm using this approach because I need to store the newly created object, then work with it in a new top-level event which is a C2 issue.farflamex2013-02-11 16:15:02