I did this a while ago, but I guess I’ve been digging though my old AS2 to give anyone who needs it a little boost A while ago, ahh… well maybe not too long ago.
I made it because it always p@#$ed me off that the sound object was so crappy in flash. Countless steps to make the sound do what you want in a way a normal person would think of to control a sound. So I added many many new properties and methods, all of which are built over top the original sound object. I kept most of the old methods as well. But now all methods, including getters and setters, fire events, to make controlling the sound a heck of a lot easier. Now muting doesn’t just turn the volume down … well essentially it still does, but I took care of the memory variables in the class. So no more remembering the last volume, or the last play position, etc.,etc… it’s all already taken care of in the methods of the class.
A good way to think of this is the Sound controller. But I made this before I ever heard of Model-View-Controller :tb:
So…
Let me know what you think, I don’t think I have ever really shown this to anyone before. This was actually my first stab at an AS2 class, period.
When you test the source file I should have everything trace to test the events, and the class sould also be commented fairly well.
The example here:
The source here:
By the way, there’s a song in that source file. I’m trusting everyone not to use it for copyright infringement