主题:  FLASH MX AS解答疑问--2

dearsammi

职务:普通成员
等级:1
金币:0.0
发贴:103
#12002/3/10 20:41:54
FLASH MX AS解答疑问--2

Sound.prototype.atcPLay=function(id,loop){this.attachSound(id);this.start();if(loop)this.onSoundComplete=this.start};

mxSnd=new Sound();
是新建立一个SOUND的涵数
mxSnd.atcPlay("sound1",true);

mxSnd.atcPlay("sound1",true);
Sound.prototype.atcPLay=function(id,loop){this.attachSound(id);this.start();if(loop)this.onSoundComplete=this.start};
以上2句AS是什么意思呢?
prototype是什么意思如何使用,作用是什么呢?
可以将Sound.prototype.atcPLay=function(id,loop){this.attachSound(id);this.start();if(loop)this.onSoundComplete=this.start};
一个一个解释一下吗?
是什么意思呢???
谢谢

好象在FALSH MX中没有声音面版了!要使声音循环只有那样作吗???

onSoundComplete事件发生在声音结束时,这时,只要把start方法作为处理函数即可实现无限循环。
这句话是什么意思呢?
具体解释一下好吗
谢谢
最好作个例子!

mxSnd.duration
mxSnd.position
这2个参数是什么意思呢?
一个是声音的总的长度吗?
还有一个是当前播放的长度吗?
但是我测试时duration它是固定的啊!
我作了循环也是固定的!什么原因呢?



东方楚楚

职务:普通成员
等级:1
金币:0.0
发贴:44
#22002/3/10 21:20:27
mxSnd.atcPlay("sound1",true);
Sound.prototype.atcPLay=function(id,loop){this.attachSound(id);this.start();if(loop)this.onSoundComplete=this.start};

下面一句定义了一个声音循环播放的函数,这个函数带两个参数,id和loop,id是一个字串参数,对应声音名,loop是一个布尔参数,true或false。{}中的意思是:从库中调入声音,开始播放,如果loop值为true,则当声音播放结束后又开始播放,即循环。
上面一句调用这个函数。



Demon.S

职务:版主
等级:5
金币:10.0
发贴:2468
#32002/3/10 21:36:15
duration是总长度,当然是固定的。



dearsammi

职务:普通成员
等级:1
金币:0.0
发贴:103
#42002/3/11 12:51:14
那mxSnd.position呢?
为什么它也不动呢?

mxSnd.duration
mxSnd.position
一个是声音的总的长度吗?
还有一个是当前播放的长度吗?
我的理解对吗???
SAMMI



5D非线性编辑版主

职务:版主
等级:4
金币:10.0
发贴:1505
#52002/3/11 13:33:05
mxsnd.position
mxsnd.duration
都是MX的只读函数,不能指定,你的理解是对的 ;)



dearsammi

职务:普通成员
等级:1
金币:0.0
发贴:103
#62002/3/11 13:46:54
谢谢
那为什么
那mxSnd.position呢?
为什么它也不动呢?

应该是动态的啊!
你说呢???

作个例子看看好吗
谢谢



手工感情

职务:普通成员
等级:3
金币:10.0
发贴:556
#72002/3/11 15:47:04
这要看你是不是动态返回这个函数了,例如你可以这样
_root.onEnterFrame = function () {
    trace (mxSnd.position);
}
测试看看

编辑历史:[这消息被handmade编辑过(编辑时间2002-03-11 15:47:23)]

黑色的风略过我的翅膀,我却无法落下来梳理你的羽毛
————————————————
◆5d.cn互动论坛◆
------|xml版主|------