Voilà ce que ça donne en pratique :
Code : Tout sélectionner
http://perso.numericable.fr/mael.bathfield/krpano/boutons_son/
Voici le code complet de cet exemple:
Code : Tout sélectionner
<krpano version="1.0.8" >
<!-- showtext style -->
<textstyle name="DEFAULT" font="Arial" fontsize="10" border="false" background="false" textcolor="0xFFFFFF" effect="glow(0x000000,0.7,4,2);dropshadow(2,45,0x000000,3,1);" />
<view hlookat="90"
vlookat="0"
maxpixelzoom="1.0" fovmax="110" />
<preview type="CUBESTRIP" url="preview.jpg" />
<!-- boutons Son ON/OFF -->
<plugin name="sound_off" url="boutons_son.png" crop="150|0|50|80" visible="false" zorder="2" keep="true" width="25" height="40" align="leftbottom" x="100" y="10" blendmode="screen" onhover="showtext(Arrêter son)"
onover="set(blendmode,layer); set(NOHIDE,false); set(plugin[slider_bg].visible,true); tween(plugin[slider_bg].alpha,1,0.1);" onout="set(blendmode,screen); delayedcall(1, if(NOHIDE== false, tween(plugin[slider_bg].alpha,0,0.2);)); " onclick="action(sound_off)" />
<plugin name="sound_on" url="boutons_son.png" crop="0|0|50|80" visible="true" zorder="2" keep="true" width="25" height="40" align="leftbottom" x="100" y="10" blendmode="screen"
onhover="showtext(Jouer Son)" onover="set(blendmode,layer);" onout="set(blendmode,screen);" onclick="action(sound_on1)"/>
<action name="sound_off">
tween(plugin[slider_bg].alpha,0,0.2,null,set(plugin[slider_bg].visible,false));
set(plugin[sound_off].visible,false);
set(plugin[sound_on].visible,true);
stopallsounds();
</action>
<!-- chargement plugin son -->
<plugin name="soundinterface"
url="../plugins/soundinterface.swf"
keep="true"
preload="true"
rootpath=""
volume="1"
onloaded="preloadsound(son1.mp3);"
/>
<!-- Son à lancer -->
<action name="sound_on1">
stopallsounds();
set(plugin[sound_on].visible,false);
set(plugin[sound_off].visible,true);
playsound(son1,son1.mp3,1,set(plugin[sound_on].visible,true);set(plugin[sound_off].visible,false); );
</action>
<!-- Barre de volume -->
<plugin name="slider_bg" url="boutons_son.png" crop="201|0|270|80" zorder="2" keep="true" align="leftbottom" width="150" height="40" x="130" y="10" visible="false" handcursor="false" alpha="0" onhover="" onover="set(NOHIDE,true); set(plugin[slider_bg].visible,true); tween(plugin[slider_bg].alpha,1,0.1); " onout="set(NOHIDE,false); tween(plugin[slider_bg].alpha,0,0.2) ;" />
<plugin name="slider_grip" url="boutons_son.png" crop="470|0|25|80" zorder="3" keep="true" align="lefttop" parent="slider_bg" width="15" height="48" x="133" y="-4" onhover=""
ondown="startdragingslider();"
onup="stopdragingslider();"
/>
<action name="startdragingslider">
set(plugin[slider_grip].backup_align, get(plugin[slider_grip].align));
set(plugin[slider_grip].backup_edge, get(plugin[slider_grip].edge));
plugin[slider_grip].changeorigin(lefttop,lefttop);
sub(mouse_x_offset, plugin[slider_grip].x, mouse.x);
sub(mouse_y_offset, plugin[slider_grip].y, mouse.y);
set(image_dragging,true);
dragslider();
</action>
<action name="stopdragingslider">
set(image_dragging, false);
</action>
<action name="dragslider">
if(image_dragging,
add(xpos, mouse.x, mouse_x_offset);
sub(xmax, plugin[slider_bg].width, plugin[slider_grip].width);
if(xpos LT 0, set(xpos,0));
if(xpos GT xmax, copy(xpos,xmax));
copy(plugin[slider_grip].x, xpos);
<!-- val = 0.0 ... 1.0 -->
div(val, xpos, xmax);
setvolume(get(val));
if(val == 0, set(plugin[sound_off].crop,0|0|50|80););
if(val GT 0.2, set(plugin[sound_off].crop,50|0|50|80););
if(val GT 0.4, set(plugin[sound_off].crop,100|0|50|80););
if(val GT 0.7, set(plugin[sound_off].crop,150|0|50|80););
delayedcall(0.01, dragslider() );
,
plugin[slider_grip].changeorigin(get(plugin[slider_grip].backup_align), get(plugin[slider_grip].backup_edge));
);
</action>
<action name="setvolume">
set(soundinterface.volume,%1)
</action>
</krpano>
Code : Tout sélectionner
http://perso.numericable.fr/mael.bathfield/krpano/boutons_son/boutons_son.png
... libre à vous d'en changer si vous voulez quelque chose de personnalisé