home *** CD-ROM | disk | FTP | other *** search
- class com.neodelight.std.XSoundChannel extends Sound
- {
- var id;
- var playing;
- var locked;
- var groups;
- var mc;
- var channel;
- var volume;
- var group;
- var fading;
- function XSoundChannel(id, mc, groups)
- {
- super(mc);
- this.id = id;
- this.playing = false;
- this.locked = false;
- this.groups = groups;
- this.mc = mc;
- this.mc.channel = this;
- this.mc.onEnterFrame = function()
- {
- if(!this.channel.fading)
- {
- return;
- }
- var _loc2_ = this.channel.getVolume() + this.channel.fadeSpeed * 100;
- _loc2_ = this.channel.fadeSpeed <= 0 ? Math.max(this.channel.fadeTo,_loc2_) : Math.min(this.channel.fadeTo,_loc2_);
- if(_loc2_ == this.channel.fadeTo)
- {
- this.channel.fading = false;
- if(this.channel.fadeOutFlag)
- {
- this.channel.stop();
- this.channel.locked = false;
- this.channel.playing = false;
- this.channel.fading = false;
- }
- }
- this.channel.setVolume(_loc2_);
- };
- }
- function setVolume(volume)
- {
- if(volume != undefined)
- {
- this.volume = volume;
- }
- super.setVolume(Math.max(0,Math.min(100,this.volume * 100 * this.groups[this.group])));
- }
- function stop()
- {
- this.locked = false;
- this.playing = false;
- super.stop();
- }
- function onSoundComplete()
- {
- this.playing = false;
- this.locked = false;
- this.fading = false;
- }
- }
-