我有一个Flash文档(Actionscript-3),该图像的顶部有播放按钮,单击该按钮时会播放音频。单击播放音频时如何使播放按钮消失。音频播放完毕后,该按钮应重新出现。
最佳答案
在您的按钮中单击处理程序:
protected function click_Button(e:MouseEvent):void {
(e.currentTarget as DisplayObject).visible=false;
var sound:SoundChannel = yourSound.play(0, 1);
sound.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);
}
protected function onSoundComplete(e:Event):void {
yourButton.visible = true;
(e.currentTarget as EventDispatcher).removeEventListener(Event.SOUND_COMPLETE, onSoundComplete);
}
关于flash - 播放音频时使闪光灯按钮消失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7041838/