【问题标题】:Qooxdoo sound button on/off doesnt workQooxdoo 声音按钮开/关不起作用
【发布时间】:2015-07-02 13:43:34
【问题描述】:

我在代码中捕获按钮:this.buttons.Sound.addListener("pressed", this.__sound, this);

然后写函数,但是我按下按钮声音关闭/打开它们没有工作。

__sound: function(){
  if (this.buttons.Sound.isEnabled()){
     createjs.Sound.volume = 1;
   } else {
     createjs.Sound.volume = 0;
   }
},

【问题讨论】:

    标签: javascript createjs qooxdoo soundjs


    【解决方案1】:

    在这一切工作之后

    __sound: function(){
    
    if (this.buttons.Sound.isEnabled()){
    createjs.Sound.setVolume(1);
    } else {
    createjs.Sound.setVolume(0);
    }
    },
    

    【讨论】:

    • 您使用的是什么版本的 SoundJS? getter/setter 属性是在 0.6.1 中添加的,而在以前的版本中您必须使用 setVolume 方法。
    • 我用的是0.6.1版本。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-23
    • 1970-01-01
    • 2017-10-21
    • 2015-08-29
    相关资源
    最近更新 更多