As all the excitement from the holidays dies down, I’ve finally found a bit more time to work. I ended up neglecting the blog there for a few weeks but I’m going to attempt to get posts done at least once a week.
That being said, sorry for leaving ya’ll in the dust. As compensation I offer you my brand new SoundManager class! I’ve always hated dealing with sounds in AS3, they make it kind of hard if you want to do anything interesting with them, because then you have to deal with 3 different classes:
Sound SoundTransform SoundChannel
With my new class, I’ve eliminated this pain. SoundManager and its functions require no instantiation, so you can reference it right off the bat.
private var sound:Sound = new TitleMusic(); private var loops:int = 10; // add sound to play SoundManager.addSound(sound, "titleMusic", SoundManager.MUSIC ); // play sound SoundManager.playSound("titleMusic", loops) // stop sound SoundManager.stopSound("titleMusic"); // mute/unmute sounds of type MUSIC SoundManager.musicMuted = true; // mute/unmute sounds of type SOUND SoundManager.soundMuted = true; // set volume of music and sound* SoundManager.musicVol = .5; SoundManager.soundVol = 1;
*Setting the volume will undo muting, so take that into account when you call it.
Most of the time the most up-to-date download will be at GitHub, so I advise you download from there. I will post here whenever a big update is released, but not all the time.
Thanks for reading, criticism and suggestions are always welcome! If you’re feeling particularly helpful today, go check the project out on GitHub and fork it!