
Код AS3:
sndPlayPauseBtn.addEventListener(MouseEvent.CLICK, clickHandler);
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
function enterFrameHandler(e:Event):void {
if (qw_cont.myz.currentFrame == 79) {
if (pauseTr) clickHandler(null);
}
}
function clickHandler(e:*):void{
if (pauseTr){
soundPosition = soundChanel.position;
soundChanel.stop();
pauseTr = false;
} else {
soundChanel = new MySound().play(soundPosition,99999999);
pauseTr = true;
}
}