Sie sind nicht angemeldet.

1

Samstag, 13. Juni 2009, 13:21

Audio Button

Hello


I would like to have a button in my virtual tour that when clicked it would play a mp3 audio file - and when the user clicks it again it would stop the sound?
Each panorama in the tour needs its own individual audio file assigned to the audio button per that panorama - Thanks in advance for any help!!


Kent

2

Sonntag, 14. Juni 2009, 13:28

Hi,

here is an example for this: (for the 1.0.8 beta 8)

add/load the soundinterface in the "first" xml:

Quellcode

1
<plugin name="soundinterface" url="soundinterface.swf" preload="true" keep="true" />


and a button to play/stop the sound:

Quellcode

1
<plugin name="soundbutton" ... onclick="action(playorstopsound);" />


and then add this in every pano xml, it will start or stop the sound (a custom variable "isplaying" is used to save the state if the sound is playing or not):
<action name="playorstopsound">
if(isplaying == true, stopsound(sound1);set(isplaying,false); , playsound(sound1, sound1.mp3);set(isplaying,true); );
</action>

and also add an event that stops the sound from the previous pano:

Quellcode

1
<events onxmlcomplete="if(isplaying == true, stopsound(sound1);set(isplaying,false); );" />


best regards,
Klaus

3

Mittwoch, 17. Juni 2009, 01:01

*w00t* works perfect!! Thanks.......

Ähnliche Themen