0
我有一個小小的音樂按鈕,點擊後會停止音樂頻道,再次點擊時播放它。它開始打球,當我點擊它,我得到一個錯誤:ReferenceError:錯誤#1069:在flash.media.SoundChannel上找不到屬性,並且沒有默認值。 - 簡單音樂「按鈕」
以下是完整的錯誤:
ReferenceError: Error #1069: Property running not found on flash.media.SoundChannel and there is no default value.
at [PROJECTNAME]::MainTimeline/fl_TapHandler_8()[Rockfall_fla.MainTimeline::frame3:215]
at runtime::ContentPlayer/simulationSendTouchEvent()
at runtime::SimulatedContentPlayer/clientSocketDataHandler()
3幀線215指的是這行代碼:
if(Chn_musicLoop.running == true){
的處理音樂的小功能看起來像這樣:
function fl_TapHandler_8(event:TouchEvent):void
{
if(Chn_musicLoop.running == true){
musicIcon.alpha *= 0.5;
Chn_musicLoop.stop();
}
else{
musicIcon.alpha *= 2;
Chn_musicLoop.play()
}}
有什麼我失蹤了嗎?當我點擊「dismiss
」文本框,它停止了音樂像它應該...
Chn_musicLoop是SoundChannel? – 3vilguy
是的。這是一個聲音頻道。下面是它的代碼:「var musicLoop = new bgMusic(); var Chn_musicLoop = new SoundChannel();」 – user2789610
但是根據文檔,SoundChannel有如此'運行'參數。 http://help.adobe.com/zh_CN/FlashPlatform/reference/actionscript/3/flash/media/SoundChannel.html – 3vilguy