1.引入KRpano soundinterface插件
<plugin name="soundinterface"
url="%SWFPATH%/plugins/soundinterface.swf"
alturl="%SWFPATH%/plugins/soundinterface.js"
rootpath="%SWFPATH%/sound/ChinaP.mp3"
preload="true"
keep="true"
volume="0.6"
/>
2.events加入音樂文件
<!-- start playing the sound -->
<events name="currentpano"
keep="true"
onnewpano="playsound(bggsnd, '%SWFPATH%/sound/ChinaP.mp3', 0);"
onremovepano="stopsound(bgsnd);"
/>
3.加入音樂控制按鈕
<layer name="music" url="sound/soundonoff.png" scale="0.5" crop="0|0|50|50" zorder="999" keep="true" alpha="1" visible="true" x="5%" y="2%" align="righttop" οnclick="pausesoundtoggle(bggsnd); switch(crop, 0|0|50|50, 0|50|50|50);" />
4.加入action動作
<!-- startup action - load the first scene -->
<action name="startup" autorun="onstart">
playsound(bggsnd,'%SWFPATH%/sound/ChinaP.mp3',0);
</action>
參考自:必學網