加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

flash as2和as3添加外部声音

发布时间:2020-12-15 18:40:46 所属栏目:百科 来源:网络整理
导读: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);

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读