大家好,我刚学laya,很多东西不懂,还希望各位多多赐教!!
我现在的问题是不能播放音乐呀,代码如下:
var bg_sound:Laya.Sound =new Laya.Sound();
bg_sound.load("res/bg.mp3");
bg_sound.play(0,0);
这么写的话,声音不能播放,于是我想是不是声音没有加载完,所以又这么写了:
[code]var bg_sound:Laya.Sound =new Laya.Sound();
bg_sound.on(Laya.Event.COMPLETE,this,this.loadcom_f);
bg_sound.on(Laya.Event.PROGRESS,this,this.loadcom_f);
bg_sound.on(Laya.Event.ERROR,this,this.loadcom_f);
bg_sound.load("res/bg.mp3");
private loadcom_f(e:Laya.Event):void{
console.log("------------------=============")
}[/code]可是这么写了一户,发现loadcom_f根本就没有被调用,还希望各位能指点一二!!!
谢谢!!!