How to stop sound?

  • My example:

    <!-- 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="button1.png" ath="0" atv="0" onclick="playsound3D(s1,music/music1.mp3, 0,0);" />

    How to stop the concrete started melody (for exp music1.mp3)? And later to have the opportunity to start it again.

    Thanks

  • I am having a problem coordinating the "crop" of the soundonoff button with the state of the background sound: http://www.photographyoptions.net/images/mtnharbor/tour1.htm l

    There is a youtube video with music associated with the 2nd scene in called "Restaurant." I used this code to pause the background music "onremovepano:"

    Code
    <events name="currentpano"	        onnewpano="playsound(bgsnd, 'sunrise.mp3|sunrise.ogg', 0); "	        onremovepano="pausesound(bgsnd)"	         />

    Seperately, I have added the "soundonoff" button to the vtourskin.xml and have set it to "pausesoundtoggle" onclick:

    Code
    <layer name="sound_button" url="soundonoff.png" align="center" x="150" y="0" alpha="0.75" scale="0.5" onover="tween(alpha,1);" onout="tween(alpha,0.25);"	        crop="0|0|50|50" style="skin_tooltips" tooltip="Sound On-Off"	        onloaded="if(ismobile,set(scale,1));"	        onclick="pausesoundtoggle(bgsnd); switch(crop, 0|0|50|50, 0|50|50|50); "/>


    If you return to the initial scene, the background music will start again, but if you had earlier toggled the music on and off using the "soundonoff" button, a second iteration of the sound file will play over the one initiated by returning to the initial scene. In general, I am asking how to coordinate the "crop" state of the soundonoff button with that actual state of the music (on or off.)

    Thank you in advance, Reggie

Jetzt mitmachen!

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