声音淡入/淡出使用ActionScript 3 [英] Sounds fade in/out with ActionScript 3

查看:413
本文介绍了声音淡入/淡出使用ActionScript 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让输入/输出淡入在Flash(CS5)项目中的音乐。我进口的声音库,设置一个类名为ActionScript导出,而我试图淡化与TweenLite的/ TweenMax,像这样的:

I am trying to make a fade in/out in a music in a Flash (CS5) project. I imported the sound to library, set a classname for "Export for ActionScript", and I was trying to fade with TweenLite/TweenMax, like this:

var sound = new MySound();
sT = new SoundTransform(0.1);
sound.play(0,99999, c_sndEnvironment);
TweenLite.to(sound, 1, {volume: 1.0});

但它是行不通的。我试图导入卷插件上TweenLite的,并且仍然一无所获。我在所有的,虽然没有得到错误。

But it just doesn't work. I tried to import the volume plugin on TweenLite, and still nothing. I got no error at all though.

难道我做错什么?

另外,有没有什么好的(完成)AS3的音乐库?

Plus, is there any good (complete) AS3 library for music?

感谢您。 :)

推荐答案

我用TweenMax这一点,这是pretty的直观

I use TweenMax for this , it's pretty straightforward


var someSound:Sound = new Sound(new URLRequest("MySound.mp3″));
var someChannel:SoundChannel = someSound.play(0, 99999);
TweenMax.to(someChannel, 1, {volume:0, onComplete:stopSound});

http://www.greensock.com/tweenmax/

这篇关于声音淡入/淡出使用ActionScript 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆