I have a small .swf file that contains one of the characters in my game. In my main actionscript 3 project, I load the .swf from an external source and display it in my game. It works fine, however, I would also like the swf to contain a short sound clip that should be played whenever the character is clicked on.
I know I could add an onClick listener to the small .swf itself and write code in Flash Professional to play the sound. The problem is that I have an options menu in my game that allows the user to specify the volume of such sounds, and I believe such information would be unavailable to the externally loaded .swf
So the sound file needs to somehow be packaged inside the character .swf, but I also need to be able to play it through my custom 'SoundPlayer' class I have in my actionscript project. Any ideas how I could achieve this?