num = 0;
mysound = new Sound();
mysound.attachSound("mysound");
_root.onEnterFrame = function() {
//_root.time = mysound.position/100
time = int(mysound.position/1000);
//trace(time);
b1.onRelease = function() {
stopAllSounds();
mysound.start(0,1);
num = 10;
};
b2.onRelease = function() {
stopAllSounds();
mysound.start(10, 1);
num = 20;
//trace(1)
};
b3.onRelease = function() {
stopAllSounds();
mysound.start(20, 1);
num = 30;
//trace(1)
};
if (time>=num) {
mysound.stop();
}
};
flash里有三个按钮b1、b2、b3,按下第一个按钮播放声音的0—10秒,按下第二个按钮播放10—20秒。第三个播放20—30秒。用这段代码反复按几次按钮后,就会出现,按下按钮不出声音的情况,要按好几下才会出声。。百思不得其解。
mysound = new Sound();
mysound.attachSound("mysound");
_root.onEnterFrame = function() {
//_root.time = mysound.position/100
time = int(mysound.position/1000);
//trace(time);
b1.onRelease = function() {
stopAllSounds();
mysound.start(0,1);
num = 10;
};
b2.onRelease = function() {
stopAllSounds();
mysound.start(10, 1);
num = 20;
//trace(1)
};
b3.onRelease = function() {
stopAllSounds();
mysound.start(20, 1);
num = 30;
//trace(1)
};
if (time>=num) {
mysound.stop();
}
};
flash里有三个按钮b1、b2、b3,按下第一个按钮播放声音的0—10秒,按下第二个按钮播放10—20秒。第三个播放20—30秒。用这段代码反复按几次按钮后,就会出现,按下按钮不出声音的情况,要按好几下才会出声。。百思不得其解。