You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Wednesday, September 30th 2009, 12:24pm

Need help for sound plugin

Hello

it is possible to load/stop soundfile depends on scene and continous??

i mean

"if i go from scene1 to scene2 play sound1"
"if i go from scene 2 to scene 3 still play sound1 (not from begiining)"

but

"if i go from scene 1 to scene 4 playsound2"
"if i go from scene 4 to scene 5 continous play sound2 (not from begining)"


i know it can be done via hotspots on click but i have a lot of hotspots on each pano and i want to use other method if possible?



i tried now this way (on each scene)

<scene name="scene1" onstart="action(mutesound1); action(playsound2)">

now is few scenes with sound1 enable and sound2 disable and few scenes with sound2 enable and sound1 disable - is what i want but i need not reloaded mp3 every scene

is possible without every hotspot onclick operations?


also it can be done easy with "grouping" scenes, it is possible? to make "group1 on start" and group1 = scene1, scene2, scene3?


sorry if questions aint smart :) im newbie in this :)

This post has been edited 3 times, last edit by "pavka" (Sep 30th 2009, 1:20pm)


2

Tuesday, October 6th 2009, 11:02am

Hi,

yes, that would be possible,

define an action for the sound outside the scenes, and call this action on every scene onstart,
and before calling set a custom variable to the current scene name, and a other variable to the last one,

e.g.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<scene name="scene1" 
       onstart="set(lastscene,get(currentscene)); set(currentscene,scene1); soundsetup();">
...
</scene>

<scene name="scene2" 
       onstart="set(lastscene,get(currentscene)); set(currentscene,scene2); soundsetup();">
...
</scene>

...

<action name="soundsetup">
  if(lastscene == scene1,
     if(currentscene == scene1, ...);
     if(currentscene == scene2, ...);
    );
  if(lastscene == scene2,
     if(currentscene == scene1, ...);
     if(currentscene == scene2, ...);
    );
</action>


best regards,
Klaus

Similar threads