flash as2和as3添加外部声音

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);
};



你可能感兴趣的:(function,Flash,音乐)