actionscript-3 – 如何阻止声音在as3中播放?

我在第二帧中有这个代码来播放一首歌,它运行正常.我的库中的声音类是“MySound”.

var snd:MySound = new MySound
snd.play();

现在我需要这首歌停止播放后一帧.

解决方法

你必须使用SoundChannel类:

var mySound:Sound = new Sound();
var myChannel:SoundChannel = new SoundChannel();
mySound.load(new URLRequest("myFavSong.mp3"));
myChannel = mySound.play();

// ...

myChannel.stop();

参考:http://www.republicofcode.com/tutorials/flash/as3sound/(第4节 – 停止声音)

相关文章

  译序:JWMediaPlayer是开源的网页使用的Flash播放器。本...
    Flash编程原理都是只能将1写为0,而不能将0写成1.所...
 上传setenvgatewayip192.168.1.1;setenvserverip192.168.1...
Error:FlashDownloadFailed-"Cortex-M3"出现一般有...
jPlayer是一个用于控制和播放mp3文件的jQuery插件。它在后台...
#ifndef__FONTUPD_H__#define__FONTUPD_H__#include"sy...