I have a bunch of items that I loop through, when the user selects the item, it does a few things.
- Plays a sound
- Animates the selected item (scales and adds glow)
- Scales any other other item not equal to selected item or * down to original size.
That works ok but I wanted to bullet proof this by adding another condition which basically checks that if the selected item is clicked and the sound has not loaded don’t do anything. Currently when you select an item it scales up and plays the sound and if you select another item while the sound is playing it scales down every item until you select a new item when it is done loading.
If anyone can please take a look at the code I have attached and give me some pointers that would be greatly appreciated.