flash添加外部声音
as3
下面试添加背景音乐的方法
//添加背景音乐
var request:URLRequest=new URLRequest("月亮船.mp3");
var shengyin:Sound=new Sound();
var con: SoundChannel = new SoundChannel();
shengyin.load(request);
con = shengyin.play(0,99);
下面是添加短声音的方法
var req:URLRequest = new URLRequest("Sound/"+ar1[k][0] + ".mp3");
var s:Sound = new Sound(req);
s.play();
as2
方法一:
neirong_sound.loadSound("Sound/"+ Name + ".mp3", true);
trace("Sound/"+ Name + ".mp3");
方法二:
bg_sound = new Sound();
bg_sound.loadSound("Sound/保龄雪球.mp3", true);
bg_sound.onSoundComplete = function ()
{
bg_sound.start(0, 100);
};
本文详细介绍了使用ActionScript 3.0在Flash中添加背景音乐和短声音的方法,包括创建声音实例、加载音频文件以及播放声音的步骤。
1万+

被折叠的 条评论
为什么被折叠?



