当我单击按钮时,我退出了 Flash 应用程序。我想要的是当我点击他的声音响起并完成后,然后退出flash应用程序。
这是我的代码
Exit.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_4);
function fl_MouseClickHandler_4(event:MouseEvent):void
{
var button:button1 = new button1();
var myChannel:SoundChannel = button.play();
if (myChannel !=null)
{
fscommand("quit");
}
}
我应该怎么做这些代码
是的,我已经明白了,这是我的有效代码
import flash.events.MouseEvent;
import flash.media.Sound;
function fl_MouseClickHandler_4(event:MouseEvent):void
{
var button:button2 = new button2();
var myChannel1:SoundChannel = button.play();
myChannel1.addEventListener(Event.SOUND_COMPLETE, onPlaybackComplete);
}
function onPlaybackComplete(event:Event)
{
fscommand("quit");
}