Sie sind nicht angemeldet.

Run

Anfänger

  • »Run« ist der Autor dieses Themas

Beiträge: 41

Wohnort: maryland. USA

Beruf: Photographer

  • Nachricht senden

1

Donnerstag, 8. März 2012, 19:35

Turning sound off on scene exit?

I have the following sound code for a hotspot inside a scene for my tour, although I have the keep=false set the sound continues to play even when a new scene has been loaded. The audio is specific to only one scene.

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
	<!-- Beginning of Sound Code-->
		<plugin name="soundinterface" url="soundinterface.swf" rootpath="%CURRENTXML%" preload="true" keep="false"/>
	
	
	<!-- a button to mute/unmute the sound -->
	<plugin name="snd" url="soundonoff.png" align="leftbottom" x="10" y="10" alpha="0.25" scale="1.0" 
		    onover="tween(alpha,1);" 
		    onout="tween(alpha,0.25);" 
	        crop="0|0|50|50"
			onclick="switch(soundinterface.mute); switch(crop, 0|0|50|50, 0|50|50|50);" />


	<!-- play sound at 0/0 -->
	<hotspot name="b1" url="headset.png" ath="18"   atv="45" scale="0.3" zoom="true"
		         alpha="0.6"
				 onover="tween(alpha,1);tween(scale,.6);"
		         onout="tween(alpha,0.6);tween(scale,0.3);"
				 onclick="playsound3D(s1,Audio32.mp3, 0,0);set(autorotate.enabled,false)" />
				 
				 <!-- End of sound code-->


if this is not the correct way to stop a sound when leaving a scene please let me know what to do.

Thank you in advance.

Rick

2

Freitag, 9. März 2012, 08:25

Hi,

there are several possibilities:

  1. call stopsound(name) to stop the sound before calling the loadpano/loadscene actions

  2. call stopallsounds() to all sounds before calling the loadpano/loadscene actions

  3. use a global onremovepano event and call there stopallsounds() , e.g.

    Quellcode

    1
    
    <events onremovepano="stopallsounds()" />


  4. use a scene local onremovepano event and call there stopallsounds() or stopsound(name) , e.g.

    Quellcode

    1
    2
    3
    4
    5
    
    <scene ...>
    ...
    <events name="sceneevents" onremovepano="stopsound(snd);" />
    ...
    </scene>


btw - keep="false" can't and shouldn't be used for the soundinterface plugin - the sound-'interface' plugin only adds new actions for playing sound, but not the sounds itself,

best regards,
Klaus

Run

Anfänger

  • »Run« ist der Autor dieses Themas

Beiträge: 41

Wohnort: maryland. USA

Beruf: Photographer

  • Nachricht senden

3

Freitag, 9. März 2012, 08:44

Klaus,

Thank you very much, I was so hung up on getting the keep= working I didn't even check the stop sound actions. Sorry major brain fart. Thank you very much for the help.

Rick