flash - 播放音频时使闪光灯按钮消失

标签 flash actionscript-3 button audio click

我有一个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/

相关文章:

html - IFRAME 内的 Flash 在 Safari 上中断位置 :fixed elements

ios - 适用于 iOS8 的 Adob​​e Air : Geolocation not working

R Shiny 取消选中带有操作按钮的复选框组

java - 处理多个按钮

flash - 调用 example Function() 和 example Function.call() 有什么区别?

html - 使flash成为html中的背景(全屏)

actionscript-3 - 为什么 delete( DictionaryInstance[ key ] );失败?

php - as3 和 php 变量问题

sql - 参数计数不匹配?但我相当肯定他们匹配

C# 在 "Code-Created"按钮中应用单击事件监听器