闪光灯中的音量控制

时间:2011-04-28 06:41:16

标签: flash

我在flash中有一个横幅。一个有大量图层的大型电影剪辑。在一层我放弃了我的声音,添加了一个完美的音量控制。在我添加音量控制之前,一旦我的横幅完成,旋律也是如此。现在它循环和循环(只是旋律)。一旦横幅结束(没有停止btn),是否有任何编码可以使我的旋律停止。这是我的音量和旋律代码:

var left:Number = controller_mc._x-100;
 var right:Number = controller_mc._x;
 var top:Number = controller_mc._y;
 var bottom:Number = controller_mc._y;

 _root.vol = 100;

 mysound = new Sound();
 mysound.attachSound("entertainerloop.wav");
 mysound.start();

 controller_mc.onPress = function()
 {
 startDrag("controller_mc",false,left,top,right,bottom);
 dragging = true;
 controller_mc.text_mc._visible = true;
 }

 controller_mc.onRelease 
 controller_mc.onReleaseOutside = function()
 {
 stopDrag();
 dragging = false;
 controller_mc.text_mc._visible = false;
 }

 controller_mc.onEnterFrame = function()
 {
 if(dragging)
 {
 var level = 100 + ( controller_mc._x - right);
 _root.vol = Math.round(level);

 if(_root.vol > 75)
 {
 _root.volume_mc.gotoAndStop(1)
 }
 if(_root.vol < 75)
 {
 _root.volume_mc.gotoAndStop(2)
 }
 if(_root.vol < 50)
 {
 _root.volume_mc.gotoAndStop(3)
 }
 if(_root.vol == 0)
 {
 _root.volume_mc.gotoAndStop(4)
 }

 mysound.setVolume(_root.vol)
 }
 mysound.onSoundComplete = function()
 {
 mysound.start();
 }
 }

1 个答案:

答案 0 :(得分:1)

只需删除(在脚本末尾):

mysound.onSoundComplete = function() { mysound.start(); }