That's because the "on collision with" condition picks the ship that has been attacked but no cannon is selected, so when you ask the cannon to flash, the code is asking all of the cannons in the game to flash.
An easy way to solve this would be to add the cannon to a container with the ship. That way when the ship is picked, the cannon on that ship is also picked.
You may need to modify the way you spawn the ships if you add the cannon to a container as any object in a container is also created when the initial object is created.