• Hello,
    I am beginner: I have get to play a background sound in my vtour, but I cannot get to show and use a button on/off fo sound like it is in the examples of krpano.
    The code I am trying is:

    Code
    <!-- a button to pause/play the sound -->
    	<layer name="snd" url="soundonoff.png" align="leftbottom" x="10" y="10" alpha="0.25" scale="0.5" onover="tween(alpha,1);" onout="tween(alpha,0.25);"
    	       crop="0|0|50|50"
    	       onclick="pausesoundtoggle(bgsnd); switch(crop, 0|0|50|50, 0|50|50|50);"
    	       />


    adn this is the xml I have write:


    Has anybody any idea of where is the problem?
    Thnak a lot.

    Einmal editiert, zuletzt von aferferro (27. Januar 2022 um 08:08)

  • Hi,

    add keep="true" to the layer of the button to avoid that it get removed:

    Code
    <layer name="snd" ... keep="true" ...

    And in the playsound call use 'bgsnd' instead of 'auto':

    Code
    playsound('auto',sound/blur.mp3);

    Otherwise the

    Code
    pausesoundtoggle(bgsnd)

    call will not work.

    Best regards,
    Klaus

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!