看板 Flash 關於我們 聯絡資訊
請問各位大大: SoundChannel.soundTransform 與 SoundTransform的差異性在哪呢? 我簡單測試了一下: var sound:Sound = new Sound(); sound.load(new URLRequest("music.mp3")); var myChannel:SoundChannel = new SoundChannel(); var mytransform:SoundTransform = new SoundTransform(); stage.addEventListener(MouseEvent.CLICK,go) myChannel = sound.play(); function go(event:MouseEvent){ var aa = myChannel.soundTransform; aa.volume -=0.1; myChannel.soundTransform = aa; } 與 var sound:Sound = new Sound(); sound.load(new URLRequest("music.mp3")); var myChannel:SoundChannel = new SoundChannel(); var mytransform:SoundTransform = new SoundTransform(); stage.addEventListener(MouseEvent.CLICK,go) myChannel = sound.play(); function go(event:MouseEvent){ mytransform.volume-=0.1; myChannel.soundTransform = mytransform ; } 看起來 SoundChannel 裡的 soundTransform,與 SoundTransform 沒什麼差異... 但是實際上這兩個的關係真的沒差嗎...? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.230.29.6
KawasumiMai:沒差,因為物件是一樣的 03/11 13:08
KawasumiMai:每個屬性有它自己的類型,如name是String,x是float 03/11 13:09
KawasumiMai:SoundChannel裡面的soundTransForm 03/11 13:09
KawasumiMai:實際上就是個SoundTransform物件掛在他下面 03/11 13:09
KawasumiMai:第一種你是拿一個新的SoundTransform抓進去取代 03/11 13:10
KawasumiMai:第二種則是把他的SoundTransform抓出來修改後取代 03/11 13:10
KawasumiMai:問題在new SoundTransform的時候他抓到什麼資訊 03/11 13:11
heavenbetula:原來如此!感謝! 03/11 19:18