用链接声音,
先把声音导入到库,然后右键,链接,选中第一个勾,这时有个标识符,比如是a.mp3
建立两个按钮,比如实例名为soundbtn, 和soundbtn2
然后在帧上写入代码
mysound = new Sound();
mysound.attachSound("a.mp3");
soundbtn.onRelease = function() {
mysound.start();
};
soundbtn2.onRelease = function() {
mysound.stop();
};