hi,i use this code to play different background sound in each scene,
<krpano onstart="playsound(bg, backgroundmusic.mp3); loadscene(scene1,null,MERGE);">
<plugin name="soundinterface" url="soundinterface.swf" alturl="soundinterface.js" preload="true" />
<scene name="scene1">
<events name="scene1events" onxmlcomplete="playsound(scene1sound, scene1music.mp3);" onremovepano="stopsound(scene1sound);" />
</scene>
<scene name="scene2">
<events name="scene2events" onxmlcomplete="playsound(scene2sound, scene2music.mp3);" onremovepano="stopsound(scene2sound);" />
</scene>
</krpano>
but i need to build 3 button in 3 languages as background sound. when i click 1 button the language in all scene will turn to 1 language.
my idea is put 3 language in 3 folder, when 1 kind language onclick, all background sound url change.
is it posibble, how to do?
how to change background sound in every scene
-
-
hi,
this is fairly simple to do.
so the button Dutch is clicked. Then set for example set(_lang, Dutch);
and
and
Code<action name="PlayAudio"> set(_audio, calc:'audioplayer/audio/' + _lang + '/' + scene[get(xml.scene)].audio); if(scene[get(xml.scene)].audio, playsound(sound1,get(_audio)); , stopsound(sound1); ); </action>
something like that.
EDIT: sorry.. i forgot the language.. haha .. edited in..
Hope it helps!
Tuur -
thanks a lot sage,it works fine.
i also have two language hotspot in the scene.
i want to make one onloaded action to check what' language was select for the hotspot.
how can i do? -
hi,
this is fairly simple to do.
so the button Dutch is clicked. Then set for example set(_lang, Dutch);
and
and
Code<action name="PlayAudio"> set(_audio, calc:'audioplayer/audio/' + _lang + '/' + scene[get(xml.scene)].audio); if(scene[get(xml.scene)].audio, playsound(sound1,get(_audio)); , stopsound(sound1); ); </action>
something like that.
EDIT: sorry.. i forgot the language.. haha .. edited in..
Hope it helps!
Tuurhi Tuur, another problem i haven't found before.
i also use set(_lang,chinese) in the first scene onstart, if i don't the first scene will link none mp3.
when i go back to the first scene, the language will return to chinese.
i also use action set(_lang,chinese) in startup but it doesn't work.
how to set one kind language as default. -
Call it before it loads the scene.
Tuur
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!