<krpano>


<plugin name="soundinterface" 
        url.html5="%CURRENTXML%/plugins/soundinterface.js" 
        url.flash="%CURRENTXML%/plugins/soundinterface.swf" 
        preload="true" rootpath="" volume="1.0" mute="false" dataurlcur="" />
<action name="switch_skin">
if (global.back_visible === null || global.back_visible,skin_hideskin();set(global.back_visible,false);,skin_showskin();skin_showthumbs(true);set(global.back_visible,true););
</action>
<action name="hideskin">
<!-- 现获取皮肤当前显示状态 -->
copy(global.back_visible,layer[skin_btn_hide].visible);
if (global.back_visible,skin_hideskin());

</action>
<action name="demo12">
js(alert(get(layer[skin_btn_vr].onclick)));
layer[skin_btn_vr].onclick
</action>
<action name="showskin">
if (global.back_visible,skin_showskin());
</action>
<action name="do_function">


<!-- js(vm.test(get(function))); -->
<!-- set(function1,get(function)); -->
<!-- js(alert(get(title))); -->
if (function == 'selectgroup', set_thumbs_bygroupname(get(groupname)););
if (function == 'selectmap', set_thumbs_bymapname(get(mapname)););
if (function == 'fullscreen', switch(fullscreen););
if (function == 'loadscene', tourscene(););
if (function == 'image-text', show_imagetext(););
if (function == 'inner-video', togglepause(););
if (function == 'openurl', openurl(get(openurl_url),get(openurl_target)););
if (function == 'flyhotspot', flyout_hotspot(););
if (function == 'open-video',  
  <!-- copy(global.back_visible,layer[skin_btn_show].visible); -->
  <!-- if (!back_visible,skin_hideskin()); -->
  <!-- 使用video-player插件 通过html5controls虽然能展示控件  但是只是闪现就没有了 -->
  <!-- js(alert(get(posterurl))); -->
  <!-- videoplayer_open(get(videourl),get(posterurl),get(volume));  -->   
   <!-- html5video_open(get(videourl),get(posterurl),get(volume)); -->
  js(playHtml5video(get(videourl),get(posterurl),get(volume)));
  <!-- stopsound(scene_sound);set(bg_lname,null);stopsound(click_sound); -->
  <!-- js(alert(get(bg_scene))); -->
  set(currenthot, true);
  if(get(bg_scene),pausesound(scene_sound);set(bg_scene,false),if(get(currenthot),,resumesound(scene_sound);set(bg_scene,true)));if(get(bg_background),pausesound(soundinterface);set(bg_background,false),if(get(currenthot),,resumesound(soundinterface);set(bg_background,true)));
  stopsound(click_sound);set(bg_lname,null);set(currentclick, false)
);
<!-- if (function == 'modal',js(getClickJson(get(xml.scene), get(name)));modal_open(get(openurl_url),get(modal_width),get(modal_height),get(modal_scrolling),vm);); -->
if (function == 'modal',
  modal_open(get(openurl_url),get(modal_width),get(modal_height),get(modal_scrolling),vm)
);
if (function == 'open-pic', 
  <!-- copy(global.back_visible,layer[skin_btn_show].visible); -->
  <!-- if (!back_visible,skin_hideskin()); --> 
  pic_open(get(posterurl),get(modal_width),get(modal_height)););
if (function == 'sound',do_music();); 
<!-- 处理内置插件分享/点评 -->
if(function=='builtin_plugin',builtin_plugin_open(1));
if (uonclick AND uonclick!='btnOpenVR();', nexttick(get(uonclick));); 
if(uonclick AND uonclick=='btnOpenVR();',webvr.enterVR()););

 <!-- if (uonclick AND uonclick!='vrbtn', nexttick(get(uonclick));); -->
</action>
 <action name="openwindows">
    js(openlink(%1,%2));
  </action>
<action name="do_music">
set(now_play,get(name));
<!-- 关闭语音讲解的是恢复复播放场景音乐 开启语音讲解的时候暂停场景音乐-->
if(now_play == bg_lname, set(bg_lname,null);set(currentclick, false);stopsound("click_sound");resumesound("scene_sound");set(bg_scene,true);,playsound("click_sound", calc(soundurl));set(currentclick, true);pausesound(scene_sound);set(bg_scene,false);set(bg_lname,get(name)));
</action>
  <!-- 点击热点行为 -->
<action name="do_hotspot_onclick">
<!-- 检测是否是 hotspot_edit 热点编辑模式,如果是热点编辑模式,则禁用点击事件 -->
<!-- js(alert(do_hotspot_onclick)); -->
 js(closeTalkPane());
if (global.hotspot_edit == 1,js(vm.hotspot_lookat(get(name)));,do_function(););
</action>
<action name="do_hotspot_set">
if (function == 'lensflare' ,
  <!-- remove_single_lensflare(get(name)); -->
  add_single_lensflare(get(name), get(lensflarestyle), get(ath), get(atv), get(dustmode));
  ,
  remove_single_lensflare(get(name));
  );
</action>
<action name="do_hotspot_onloaded">
<!-- 判断webvr是否已启用 -->
if(webvr.isenabled,
  if(normal == false || normal == null ,
    set(visible, false);
    ,
    set(visible, true);
    );,
  );
if (function == 'lensflare' AND visible, 
  if ( global.mode != 'edit',set(visible,false););
  add_single_lensflare(get(name), get(lensflarestyle), get(ath), get(atv), get(dustmode));
  ,
  do_crop_animation();
  );
if (uonloaded, nexttick(get(uonloaded)););
<!-- 判断是否为动态图片热点，启动定时器，不断根据配置的数据接口获取数据，根据返回数据切换图片颜色 -->
<!-- if (dataUrl, set(dataurlcur,dataUrl);switchPic();)  -->
<!-- js(alert(get(dataurlcur))); -->
if (dataUrl AND dataUrl != '' AND visible AND get(isEditPage) == 0, js(getClickJson(get(xml.scene), get(name))))
</action>
<action name="do_hotspot_onover">
if (uonover, nexttick(get(uonover)););
</action>
<action name="do_hotspot_onhover">
if (uonhover, nexttick(get(uonhover)););
</action>
<action name="do_hotspot_onout">
if (uonout, nexttick(get(uonout)););
</action>
<action name="do_hotspot_ondown">
draghotspot();
if (uondown nexttick(get(uondown)););
</action>
<action name="do_hotspot_onup">
if (uonup, nexttick(get(uonup)););
</action>
<action name="do_map_onclick">
<!-- 检测是否是 hotspot_edit 热点编辑模式,如果是热点编辑模式,则禁用点击事件 -->
if (global.map_edit == 1,js(vm.hotspot_lookat(get(name)));,do_function(););

</action>
<action name="do_map_onloaded">
do_crop_animation();
if (uonloaded, nexttick(get(uonloaded)););
</action>
<action name="do_map_onover">
if (uonover, nexttick(get(uonover)););
</action>
<action name="do_map_onhover">
if (uonhover, nexttick(get(uonhover)););
</action>
<action name="do_map_onout">
if (uonout, nexttick(get(uonout)););
</action>
<action name="do_map_ondown">
if (uondown nexttick(get(uondown)););
</action>
<action name="do_map_onup">
if (uonup, nexttick(get(uonup)););
</action>
<action name="do_onload">
if (type == 'container' || mtype == 'scrollarea',  if (function === 'container-button' AND item.count !=null, do_container_button(););  );
if (type == 'container' || mtype == 'scrollarea',  if (function === 'container-group', do_container_group_button(););  );
if (type == 'container' || mtype == 'scrollarea',  if (function === 'container-tourmaplist', do_container_tourmaplist_button(););  );

do_scrollarea();
</action>
<action name="do_scrollarea">
txtadd(bg_lname,'bg_',get(name));
if (mtype == 'scrollarea' AND containertf == 'true' AND !layer[get(bg_lname)],  addlayer(get(bg_lname));  
  <!-- trace('bg_lname:',get(bg_lname)); -->
  <!-- copyattributes(get(layer[get(bg_lname)]),get(layer[get(name)])); -->
    <!--   set(layer[bg_lname].url,);
  set(layer[get(bg_lname)].url.html5,);
  set(layer[get(bg_lname)].url.flash,); -->  copy(_parent,pparent);  copy(b_x,x);  copy(b_y,y);  copy(b_align,align);  copy(b_edge,edge);
  set(layer[get(bg_lname)].type,'container');  set(layer[get(bg_lname)].maskchildren,true);  set(layer[get(bg_lname)].keep,true);
  copy(layer[get(bg_lname)].width,bg_width);  copy(layer[get(bg_lname)].height,bg_height);
  copy(layer[get(bg_lname)].alpha,0.1);  copy(layer[get(bg_lname)].visible,visible);  if (parent != bg_lname,    copy(layer[get(bg_lname)].parent,_parent);    copy(layer[get(bg_lname)].align,b_align);    copy(layer[get(bg_lname)].edge,b_edge);

    <!--     trace('bg_lname-parent:',get(layer[get(bg_lname)].parent));
    trace('bg_lname-align:',get(layer[get(bg_lname)].align)); -->
    );  copy(layer[get(bg_lname)].x,b_x);  copy(layer[get(bg_lname)].y,b_y);  
  <!-- trace(get(layer[get(bg_lname)].x)); -->
  <!-- trace(get(layer[get(bg_lname)].y)); -->  copy(layer[get(bg_lname)].rotate,rotate);
  copy(layer[get(bg_lname)].bgcolor,bgcolor);  copy(layer[get(bg_lname)].bgalpha,bgalpha);  copy(layer[get(bg_lname)].bgborder,bgborder);  copy(layer[get(bg_lname)].bgroundedge,bgroundedge);  copy(layer[get(bg_lname)].bgshadow,bgshadow);  copy(layer[get(bg_lname)].bgcapture,bgcapture);

    <!--   trace('mylogo:',get(layer[mylogo].maskchildren));
    trace('bg_lname:',get(layer[get(bg_lname)].maskchildren)); -->
    <!-- if (inner_direction == 'false',set(align,'left');set(edge,'left');,set(align,'top');set(edge,'top');); -->
    <!-- set(align,'center');set(edge,'center'); -->
    <!--   set(width,100%);
    set(width,100%); -->
    copy(parent,bg_lname);
    set(x,0);
    set(y,0);
    set(align,'center');
    set(edge,'center');
    tween(layer[get(bg_lname)].alpha,get(alpha),1);
    );

</action>
<action name="undo_scrollarea">
<!-- trace('undo_scrollarea' ,'-',get(containertf)); -->
txtadd(bg_lname,'bg_',get(name));

if (mtype == 'scrollarea',  
  <!-- if (layer[get(bg_lname)] != null, -->  copy(parent,layer[get(bg_lname)].parent);  copy(align,layer[get(bg_lname)].align);  copy(edge,layer[get(bg_lname)].edge);  copy(x,layer[get(bg_lname)].x);  copy(y,layer[get(bg_lname)].y);  copy(width,layer[get(bg_lname)].width);  copy(height,layer[get(bg_lname)].height);
  removelayer(get(bg_lname));
  
  <!-- trace(get(layer[get(bg_lname)].name)); -->
  );

</action>
<action name="do_layer_onclick">
<!-- 判断是否是数据检测弹框预警 -->
<!-- 场景切换 -->
<!-- 删除预警弹窗 -->
<!-- 触发index.js解除预警 -->
<!-- js(alert(%2)); -->
<!-- js(alert(get(name))); -->

if (%2 AND %2 == data, 
  <!-- js(alert(get(openurl_url2))); --> 
  modal_open(get(openurl_url),get(modal_width),get(modal_height),get(modal_scrolling),vm);
  js(deleteAlert(%1));
  js(unbindWarn(%1, get(name)));
  <!-- js(getClickJson(%1, get(name))); -->
  loadscene(%1);
);

<!-- 检测是否是 layer_edit 热点编辑模式,如果是热点编辑模式,则禁用点击事件 -->
js(closeTalkPane());
if (global.layer_edit == 1,js(vm.layer_lookat(get(name),false));,do_function(););

</action>
<action name="do_layer_onclick_close">
<!-- 判断是否是数据检测弹框预警 -->
<!-- 场景切换 -->
<!-- 删除预警弹窗 -->
<!-- 触发index.js解除预警 -->
<!-- js(alert(%2)); -->
<!-- js(alert(get(name))); -->
js(hiddenNews(get(name)));

<!-- 检测是否是 layer_edit 热点编辑模式,如果是热点编辑模式,则禁用点击事件 -->
<!-- js(closeTalkPane());
if (global.layer_edit == 1,js(vm.layer_lookat(get(name),false));,do_function();); -->

</action>
<action name="do_layer_onloaded">
do_crop_animation();
<!-- js(alert("do_layer_onloaded"));
js(alert(get(xml.scene))); -->
<!-- js(alert(get(builtin_plugin_type))); -->
<!-- 移动端不展示分享layer -->
if(device.mobile AND builtin_plugin_type=='share_plugin' AND !mobileVisible,removelayer(get(name)););
<!-- 判断是否加载点评插件 -->
if(builtin_plugin_type=='talk_plugin',set(global.isLoadTalk,1);js(getTalks()););
<!-- 加载当前场景名称至场景名称显示插件 -->
if(builtin_plugin_type=='scenename_plugin',set(global.isLoadSceneName,1);js(showSceneName()););
<!--   加载点赞数量-->
if(builtin_plugin_type=='praise_plugin',js(getPraiseNum()););
<!-- 加载浏览量 -->
if(builtin_plugin_type=='browser_plugin',js(showBrowserNum()););
if (uonloaded, nexttick(get(uonloaded)););
do_onload();
</action>
<action name="do_layer_onover">
if (uonover, nexttick(get(uonover)););
</action>
<action name="do_layer_onhover">
if (uonhover, nexttick(get(uonhover)););
</action>
<action name="do_layer_onout">
if (uonout, nexttick(get(uonout)););
</action>
<action name="do_layer_ondown">
if (uondown, nexttick(get(uondown)););
</action>
<action name="do_layer_onup">
if (uonup, nexttick(get(uonup)););
</action>
<action name="makescreenshot" type="Javascript">
<![CDATA[
if (krpano.webGL &&
  krpano.webGL.context.getContextAttributes().preserveDrawingBuffer)
{
  try
  {
       //var img_src = krpano.webGL.canvas.toDataURL();
       var w=krpano.get('skin_settings.thumbs_width');
       var h=krpano.get('skin_settings.thumbs_height');
       var img_src=krpano.webGL.makeScreenshot(w?w:120, h?h:80, false); document.getElementById('imageData').src=img_src;
     }
     catch(err)
     {
       krpano.trace(3,err);
     }
   }
   else
   {
    krpano.trace(3,"no webgl or no preserveDrawingBuffer");
  }
  ]]>
  </action>
  <action name="tourscene" scope="local">
  <!-- 根据热点参数自动调用相应的场景及其效果 -->  if (caller.to_hotspot=='true',    if (caller.to_motiontype=='smooth',      looktohotspot(get(caller.name),get(view.fov),smooth(get(caller.to_accel),get(caller.to_break),get(caller.to_maxspeed)));      );    if (caller.to_motiontype=='tween',      looktohotspot(get(caller.name),get(view.fov),tween(get(caller.tween_type),get(caller.tween_times)));      );    );  if (caller.to_ath === null,,calc(vars, 'view.hlookat=' + caller.to_ath + '&amp;view.vlookat=' + caller.to_atv + '&amp;view.fov=' + caller.to_fov););  if(caller.blendtype != 'CUSTOM',    calc(flags,caller.blendtype);    );  if(caller.blend == 'NOBLEND',    calc(flags,'NOBLEND');    );  if(caller.blend == 'BLEND',    calc(flags,'BLEND('+caller.tween_time+','+ caller.tween_type+')');    );  if(caller.blend == 'COLORBLEND',    calc(flags,'COLORBLEND('+caller.tween_time+','+ caller.tween_color+','+ caller.tween_tweentype+')');    );  if(caller.blend == 'LIGHTBLEND',    calc(flags,'LIGHTBLEND('+caller.tween_time+','+ caller.tween_color+','+ caller.tween_colorscale+','+ caller.tween_tweentype+')');    );  if(caller.blend == 'SLIDEBLEND',    calc(flags,'SLIDEBLEND('+caller.tween_time+','+ caller.tween_angle+','+ caller.tween_smooth+','+  caller.tween_tweentype+')');    );  if(caller.blend == 'OPENBLEND',    calc(flags,'OPENBLEND('+caller.tween_time+','+ caller.tween_shape+','+ caller.tween_smooth+','+ caller.tween_zoom+','+  caller.tween_tweentype+')');    );  if(caller.blend == 'ZOOMBLEND',    calc(flags,'ZOOMBLEND('+caller.tween_time+','+ caller.tween_zoom+','+ caller.tween_tweentype+')');    );
  if (caller.linkscene !== null,myskin_gotoscene(get(caller.linkscene),get(vars),MERGE,get(flags)););
  
  </action>
  <!-- 启动动态图标闪烁 -->
  <!-- caller指当前热点对象 -->
  <action name="do_crop_animation" scope="local" args="framewidth, frameheight, framerate, name"> 
   <!-- js(alert(get(caller.imagewidth))); -->
   if (caller.frametf == 'true',    
        <!-- js(alert(get(caller.frameheight))); -->
        calc(local.framewidth, caller.framewidth);    
        calc(local.frameheight, caller.frameheight);    
        calc(local.framerate, caller.framerate);    
        <!-- 定义局部变量 -->    
        calc(local.xframes, (caller.imagewidth /framewidth) BOR 0);    
        calc(local.frames, xframes * ((caller.imageheight / frameheight) BOR 0));    
        def(local.frame, integer, 0);
        <!-- 设置第一帧 -->    
        calc(caller.crop, '0|0|' + framewidth + '|' + frameheight);
        <!-- 动画部分 -->      
        setinterval(
          calc('crop_anim_' + caller.name), calc(1.0 / framerate),      
          if(caller.loaded AND caller.frametf,        
            inc(frame);        
            if(frame GE frames, 
              if(caller.onlastframe !== null, 
                callwith(caller, onlastframe() ) 
              ); 
              set(frame,0); 
            );        
            mod(xpos, frame, xframes);        
            div(ypos, frame, xframes);        
            Math.floor(ypos);        
            mul(xpos, framewidth);        
            mul(ypos, frameheight);        
            calc(caller.crop, xpos + '|' + ypos + '|' + framewidth + '|' + frameheight); ,        
            <!-- 当热点移除时停止动画 -->     
            clearinterval(calc('crop_anim_' + caller.name));        
          );      
        );    
      );  
  </action>
  <action name="do_crop_animation_reset_bak">    
        clearinterval(calc('crop_anim_' + hotspot[%1].name)); 
        <!-- js(alert(get(hotspot[%1].framewidth))); -->
        calc(local.framewidth, hotspot[%1].framewidth);    
        calc(local.frameheight, hotspot[%1].frameheight);    
        calc(local.framerate, hotspot[%1].framerate);    
        <!-- 定义局部变量 -->    
        calc(local.xframes, (hotspot[%1].imagewidth /framewidth) BOR 0);    
        calc(local.frames, xframes * ((hotspot[%1].imageheight / frameheight) BOR 0));    
        def(local.frame, integer, 0);
        <!-- 设置第一帧 -->    
        calc(hotspot[%1].crop, '0|0|' + framewidth + '|' + frameheight);
        <!-- 动画部分 -->      
        <!-- setinterval(
          calc('crop_anim_' + hotspot[%1].name), calc(1.0 / framerate),      
          if(hotspot[%1].loaded AND hotspot[%1].frametf,        
            inc(frame);        
            if(frame GE frames, 
             
              set(frame,0); 
            );        
            mod(xpos, frame, xframes);        
            div(ypos, frame, xframes);        
            Math.floor(ypos);        
            mul(xpos, framewidth);        
            mul(ypos, frameheight);        
            calc(hotspot[%1].crop, xpos + '|' + ypos + '|' + framewidth + '|' + frameheight); ,        
            clearinterval(calc('crop_anim_' + hotspot[%1].name));        
          );      
        );      -->
  </action>
  <action name="do_crop_animation_reset"> 
    <!-- clearinterval(calc('crop_anim_' + hotspot[%1].name));  -->
        <!-- js(console.log(get(calc('crop_anim_' + hotspot[%1].name)))); -->
        
    clearinterval(calc('crop_anim_' + hotspot[%1].name)); 
    <!-- clearinterval(calc('crop_anim_' + get(hotspot[%1].name))) -->
     <!-- clearinterval(calc('crop_anim_hs_aepk'));  -->
            <!-- clearinterval('crop_anim_hs_aepk');         -->

    <!-- if (caller.frametf == 'true',     -->
        <!-- js(console.log(get(hotspot[%1].name))); -->
        <!-- calc(local.framewidth, 100);    
        calc(local.frameheight, caller.frameheight);    
        calc(local.framerate, caller.framerate);     -->
        <!-- 定义局部变量 -->    
        calc(local.xframes, (100 /100) BOR 0);    
        calc(local.frames, xframes * ((600 / 100) BOR 0));    
        def(local.frame, integer, 0);
        <!-- 设置第一帧 -->    
        calc(hotspot[%1].crop, '0|0|100|100');
        <!-- set(hotspot[%1].crop, '200|200|300|200'); -->
        <!-- 动画部分 -->      
        setinterval(
          calc('crop_anim_' + hotspot[%1].name), calc(1.0 / 10),      
            inc(frame);        
            if(frame GE frames, 
            
              set(frame,0); 
            );        
            mod(xpos, frame, xframes);        
            div(ypos, frame, xframes);        
            Math.floor(ypos);        
            mul(xpos, 100);        
            mul(ypos, 100);        
            calc(hotspot[%1].crop, '0|0|100|100');  
            <!-- calc(hotspot[%1].crop, xpos + '|' + ypos + '|' + framewidth + '|' + frameheight);  -->
            <!-- clearinterval(calc('crop_anim_' + caller.name));    -->
            
             ,      
            clearinterval(calc('crop_anim_' + get(hotspot[%1].name))); 
            <!-- clearinterval('crop_anim_hs_aepk');         -->
        
        );    
      <!-- );  -->
  </action>
  <!-- flyout hotspot actions -->
  <!-- flyout hotspot actions -->
  <action name="flyout_hotspot">  for(set(i,0), i LT hotspot.count, inc(i),    copy(hs, hotspot[get(i)]);    if(hs.name != name AND hs.style == 'flyoutimage' AND (hs.flying_state == 'out' OR hs.flying_state == 'flyingout'),      callwith(hs, flyout_hotspot() );      );    );
  if(flying_state == 'flyingout',    set(flying_state, 'flyingin');    ,    if(flying_state == 'flyingin',      set(flying_state, 'flyingout');      );    );
  if(flying_state == 'in',    calc(backup_state, '0.0|' + rx + '|' + ry + '|' + rz + '|' + scale);    copy(backup_zorder, zorder);    set(flying_state, 'flyingout');    );
  if(flying_state == 'out',    set(flying_state, 'flyingin');    );
  if(flying_state == 'flyingout',    set(zorder, 99);    calc(fly_state, '1.0|0.0|0.0|0.0|'+ flyscale);    tween(flying|rx|ry|rz|scale, get(fly_state), 0.5, default, set(flying_state,'out'); set(capture,true); );    );
  if(flying_state == 'flyingin',    sub(zorder,1);    set(capture,false);    tween(flying|rx|ry|rz|scale, get(backup_state), 0.5, default, set(flying_state,'in'); copy(zorder,backup_zorder); );    );  </action>
  <events name="key_events" keep="true" devices="html5" onkeydown="copy(global.current_key, keycode);set(global.keydown, 1);" onkeyup="set(global.keydown, 0);" />
  <action name="hotspot_getcurrentprop">  js(vm.hotspot_getcurrentprop(get(name)));  </action>
  <action name="draghotspot">
  <!-- 只有当热点被激活情况下才能拖拽  true暂不启用 -->  
  <!-- js(alert(get(isDrag))); -->
 if(isDrag==1,set(drag,1),set(drag,0));
 if(global.hotspot_edit == 1 AND lock!='true',set(drag,1););
  if (drag==1,
  <!-- if (lock!='true', -->
    spheretoscreen(ath, atv, hotspotcenterx, hotspotcentery, 'l');
    sub(drag_adjustx, mouse.stagex, hotspotcenterx);
    sub(drag_adjusty, mouse.stagey, hotspotcentery);
     <!-- js(alert(get(global.hotspot_edit))); -->
    asyncloop(pressed,
      sub(dx, mouse.stagex, drag_adjustx);
      sub(dy, mouse.stagey, drag_adjusty);
      screentosphere(dx, dy, ath, atv);
      do_hotspot_set();
      if (global.keydown == 1,
        if (global.current_key == 16,inc(scale,0.002)); 
        <!-- shift -->       
        if (global.current_key == 17,dec(scale,0.002));
        <!-- ctrl -->        
        if (global.current_key == 71,set(global.tf,1));        
        if (distorted,if (global.current_key == 69,inc(rz,0.10));
          <!-- r -->          
          if (global.current_key == 81,dec(rz,0.10));
          <!-- q -->          
          if (global.current_key == 65,inc(ry,0.10));
          <!-- a -->          
          if (global.current_key == 68,dec(ry,0.10));
          <!-- d -->          
          if (global.current_key == 83,inc(rx,0.10));
          <!-- s -->          
          if (global.current_key == 87,dec(rx,0.10));
          <!-- w -->      
          do_hotspot_set();    
          hotspot_getcurrentprop();,
          <!-- else -->          
          if (global.current_key == 69,inc(rotate,0.10));
          <!-- c -->          
          if (global.current_key == 81,dec(rotate,0.10));
          <!-- z -->
          do_hotspot_set();
          hotspot_getcurrentprop();
          );
        <!-- distorted -->
        ,        
        <!-- else -->       
        if ((global.tf == 1) AND (global.current_key == 71), 
          set(global.tf,0);
          switch(distorted);
          do_hotspot_set();
          hotspot_getcurrentprop();
          );        
        <!-- G --> 
        );
      ); 
    ,);  
  </action>
  <action name="demo" type="Javascript">
  <![CDATA[

  ]]>
  </action>
  <action name="dragmap">
  if (global.layer_map == 1 AND lock!='true',    copy(drag_currentx, x);    copy(drag_currenty, y);    copy(drag_stagex, mouse.stagex);    copy(drag_stagey, mouse.stagey);    indexoftxt(align_contains_right, get(align), 'right');    indexoftxt(align_contains_bottom, get(align), 'bottom');    calc(drag_align_x, align_contains_right GE 0 ? -1 : +1);    calc(drag_align_y, align_contains_bottom GE 0 ? -1 : +1);    asyncloop(pressed,      calc(x, drag_currentx + (mouse.stagex - drag_stagex)*drag_align_x);      calc(y, drag_currenty + (mouse.stagey - drag_stagey)*drag_align_y);      ,      js(vm.map_getcurrentprop(get(name)));      );
    ,);  </action>
  <events name="layer_events" onxmlcomplete="if (global.layer_edit == 1,js(vm.layers_update(););)"/>
  <action name="draglayer">
  if (global.layer_edit == 1 AND lock!='true',    copy(drag_currentx, x);    copy(drag_currenty, y);    copy(drag_stagex, mouse.stagex);    copy(drag_stagey, mouse.stagey);    indexoftxt(align_contains_right, get(align), 'right');    indexoftxt(align_contains_bottom, get(align), 'bottom');    calc(drag_align_x, align_contains_right GE 0 ? -1 : +1);    calc(drag_align_y, align_contains_bottom GE 0 ? -1 : +1);    asyncloop(pressed,      calc(x, drag_currentx + (mouse.stagex - drag_stagex)*drag_align_x);      calc(y, drag_currenty + (mouse.stagey - drag_stagey)*drag_align_y);      ,      js(vm.layer_getcurrentprop(get(name)));      );
    ,);  </action>
  <action name="mapspot_draglayer">
  copy(drag_currentx, x);  copy(drag_currenty, y);  copy(drag_stagex, mouse.stagex);  copy(drag_stagey, mouse.stagey);  indexoftxt(align_contains_right, get(align), 'right');  indexoftxt(align_contains_bottom, get(align), 'bottom');  calc(drag_align_x, align_contains_right GE 0 ? -1 : +1);  calc(drag_align_y, align_contains_bottom GE 0 ? -1 : +1);  asyncloop(pressed,    calc(x, drag_currentx + (mouse.stagex - drag_stagex)*drag_align_x);    calc(y, drag_currenty + (mouse.stagey - drag_stagey)*drag_align_y);    js(vm.mapspot_getcurrentprop(get(name),get(x),get(y)));    ,    js(vm.mapspot_getcurrentprop(get(name),get(x),get(y)));    );
  </action>
  <action name="myskin_gotoscene">  if(scene[%1],   copy(cursceneindex, scene[get(xml.scene)].index);   copy(newsceneindex, scene[%1].index);   myskin_loadscene(get(newsceneindex), %2 ,%3 ,%4 );   );  </action>
  <action name="myskin_loadscene">  if(webvr.isenabled AND scene.count GT 1,   set(hotspot[webvr_prev_scene].visible, false);   set(hotspot[webvr_next_scene].visible, false);   );
  txtadd(layer[skin_thumbborder].parent, 'skin_thumb_', get(scene[%1].index));  layer[skin_thumbs].scrolltocenter(get(scene[%1].thumbx), get(scene[%1].thumby));  loadscene(get(scene[%1].name), %2, %3, %4);  </action>
  <events name="mytooltip_events" keep="true" onnewscene="add_static_tooltip();" />
  <!-- 添加静态热点 -->
  <action name="add_static_tooltip"> 
  for(set(i,0), i LT hotspot.count, inc(i), 
    <!--根据热点选项添加热点提示信息  -->   
    if (hotspot[get(i)].tooltip,,
      if(hotspot[get(i)].showtooltip AND hotspot[get(i)].title,
       add_hotspot_tooltip(get(hotspot[get(i)].name));
       );
      );
    ); 
  </action>
  <!-- <style name="default_tooltip" type="text" url="%CURRENTXML%/plugins/textfield.swf" wordwrap="true" autoheight="true" background="true" backgroundcolor="0x000000" roundedge="5" alpha="0" backgroundalpha="0.5" border="true" padding="3" glow="4" x="0" y="-5" glowcolor="0xFFFFFF" css="text-align:center; color:#FFFFFF; font-family:MicrosoftYahei; font-size:12px;" textshadow="0 0 0 0x000000 0" textshadowrange="6.0" extshadowangle="90" enabled="true" /> -->
  
  <action name="add_hotspot_tooltip"> 
 
  if (style[default_tooltip].mode == 'hotspot',
    add_hotspot_tooltip_by_hotspot(%1);
    ,
    if(webvr.isenabled,
      txtadd(tooltipname, 'tooltip_', %1);  
      removeplugin(get(tooltipname));
      ,
      add_hotspot_tooltip_by_plugin(%1);
      );
    );
  </action>

  <action name="add_hotspot_tooltip_by_plugin"> 
  txtadd(tooltipname, 'tooltip_', %1);  
  txtadd(hname,'','%1');  
  addplugin(get(tooltipname));  
  txtadd(plugin[get(tooltipname)].parent,   'hotspot[', get(hname) , ']' );  
  if (hotspot[get(hname)].tooltipalign, 
    txtsplit(hotspot[get(hname)].tooltipalign,'|',_align,_edge);
    , 
    set(_align,bottom);
    set(_edge,top);
    );  
  copy(plugin[get(tooltipname)].edge,_edge);
  copy(plugin[get(tooltipname)].align,_align); 
  set(plugin[get(tooltipname)].html,get(hotspot[%1].title));
  if(hotspot[get(hname)].visibletitle == false, set(hotspot[get(tooltipname)].html, ""), "");
  txtadd(_onc,'callwith(hotspot[',%1,'],onclick);');  
  copy(plugin[get(tooltipname)].onclick,_onc);  
  <!-- assignstyle(plugin[get(tooltipname)], 'fashion_theme'); -->
  <!-- js(alert(%2);); -->
  if(%2!=null,assignstyle(plugin[get(tooltipname)],%2),assignstyle(plugin[get(tooltipname)], 'default_tooltip'));
  tween(plugin[get(tooltipname)].alpha,1,1);
  <!-- if(hotspot[get(hname)].crop,  set(plugin[get(tooltipname)].html,get(hotspot[%1].title));) -->
  if(hotspot[get(hname)].visibletitle == false, set(plugin[get(tooltipname)].html, "");set(plugin[get(tooltipname)].bgalpha, "0.0"), "");
  </action>

  <action name="add_hotspot_tooltip_by_hotspot">
  txtadd(tooltipname, 'tooltip_', %1);  
  txtadd(hname,'','%1');  
  addhotspot(get(tooltipname)); 
  copyattributes(get(hotspot[get(tooltipname)]),get(hotspot[%1]));
  copy(_w,hotspot[get(tooltipname)].width);
  copy(_h,hotspot[get(tooltipname)].height);
  <!-- trace(get(_w),':',get(_h)); -->
  set(hotspot[get(tooltipname)].width,'');
  set(hotspot[get(tooltipname)].height,'');

  copyattributes(get(hotspot[get(tooltipname)]),get(style[default_tooltip]));
  set(hotspot[get(tooltipname)].tooltip,true);
  <!-- 没办法的办法 start 因为copy的属性 ox oy 不响应-->
  set(hotspot[get(tooltipname)].ox,0);
  set(hotspot[get(tooltipname)].oy,0);
  copy(hotspot[get(tooltipname)].ox,style[default_tooltip].ox);
  copy(hotspot[get(tooltipname)].oy,style[default_tooltip].oy);
  <!-- 没办法的办法 start-->

  if (hotspot[get(hname)].tooltipalign, 
    txtsplit(hotspot[get(hname)].tooltipalign,'|',_align,_edge);
    , 
    set(_align,bottom);
    set(_edge,top);
    );  
    
  set(hotspot[get(tooltipname)].html,get(hotspot[%1].title));  
  tween(hotspot[get(tooltipname)].alpha,1,1);
  if(hotspot[get(hname)].visibletitle == false, set(hotspot[get(tooltipname)].html, ""), "");
  </action>


  <!-- <events name="scene_start" keep="true" onmousedown="playscenesound();subtitles_controller()" onnewscene="on_scene_start(aaa);subtitles_controller()" onremovepano="stopsound(scene_sound);stopsound(click_sound);"></events> -->
  <!-- <events name="scene_start" keep="true" onmousedown="playscenesound();" onnewscene="on_scene_start(aaa);" onremovepano="stopsound(scene_sound);stopsound(click_sound);set(currentclick, false)"></events> -->
     <!-- 事件标签 -->
  <events onxmlcomplete="onxmlcomplete" name="scene_start" keep="true" onnewpano="activeThumpic();" onmousedown="playscenesound();" onnewscene="on_scene_start(aaa);" onremovepano="stopsound(click_sound);set(currentclick, false)"></events>
  <action name="onxmlcomplete">
  <!-- js(alert(onxmlcomplete)); -->
  </action>
    <!-- 触发场景讲解 -->
  <action name="playscenesound">
   <!-- js(vm.test(scene)); -->
  <!-- js(alert(get(scene[get(xml.scene)].soundurl))); -->
  <!-- if(global.scene_sound == false || global.scene_sound == null  || global.scene_sound === null, -->
  <!-- js(alert(222);); -->
  <!-- js(vm.closeTalkPane()); -->
  <!-- 关闭视频播放弹窗 -->
  js(closeHtml5videoModal()); 
  set(currenthot, false);
  <!-- if(get(bg_scene),pausesound(scene_sound);set(bg_scene,false),resumesound(scene_sound);set(bg_scene,true));if(get(bg_background),pausesound(soundinterface);set(bg_background,false),resumesound(soundinterface);set(bg_background,true));
  stopsound(click_sound);set(bg_lname,null); -->
  if (bg_lname == null, if(scene[get(xml.scene)].soundurl, resumesound(scene_sound);set(bg_scene,true));resumesound(soundinterface);set(bg_background,true))
  if(global.scene_sound == false || global.scene_sound == ''  || global.scene_sound === null,
    <!-- js(alert(playscenesound)); -->
   set(global.scene_sound,true);
   set(isMousedown,true);
   <!-- on_scene_start(); -->
   );
  </action>
  <action name="save_scene_name" scope="local" args="">
    <![CDATA[
   if(typeof vm=="object"){
     vm.scene_name=krpano.get("xml.scene");
   }
    ]]>
    </action>
  <action name="on_scene_start">
  <!-- js(unbindWarn(get(xml.scene))); -->
  <!-- do_layer_onclick(get(xml.scene)), data); -->
  <!-- js(alert(on_scene_start)); -->
  <!-- 如果是预览模式 在场景切换时 关闭说一说弹窗 -->
  <!-- 获取说说内容 -->
  js(getTalks(true));
  <!-- 加载场景名称至场景插件 -->
  js(showSceneName());
  <!-- 触发文字滚动功能 -->
  <!-- js(scrollText()); -->
  <!-- 根据当前浏览器是否已经点过赞 更改点赞数字的样式 -->
  <!-- js(vm.changePraiseNumColor()); -->
  <!-- if(global.isPreview==1 AND isMousedown!=true,js(vm.closeTalkPane())); -->
  save_scene_name();
  <!-- 判断一次背景音乐是否需要切换 -->
  initAutoPlay();
  <!-- 播放当前场景音乐 -->
  autoPlaySceneSound();
  <!-- subtitles_controller(); -->
  js(closeTalkPane());
  <!-- 左侧缩略图联动 -->
  <!-- scene_name===scene._attributes.name -->
  <!-- activeThumpic(); -->
  <!-- 场景播放设置 -->
  <!-- txtadd(scene_sound,"group_",get(name)); -->
  <!-- js(vm.test(get(xml.scene))); -->
  <!-- if (scene[get(xml.scene)].bksound AND scene[get(xml.scene)].soundurl AND global.scene_sound, -->
   <!-- if (scene[get(xml.scene)].bksound AND scene[get(xml.scene)].soundurl, -->
   <!-- if((krpano.get("global.isEditPage")=="1"&&typeof vm=='object')||typeof vm=='undefined'){ -->
    <!-- copy(scene_soundurl,scene[get(xml.scene)].soundurl); -->
    <!-- stopsound(scene_sound); -->
    <!-- playsound(scene_sound,get(scene_soundurl)); -->
    
    <!-- pausesound(scene_sound); -->
    <!-- if(isMousedown==true,resumesound(scene_sound),playsound(scene_sound,get(scene_soundurl));set(isMousedown,false)); -->
    <!-- playsound(scene_sound,get(scene_soundurl)); -->
    <!-- 关闭点击音乐 语音讲解 -->
    <!-- stopsound(click_sound); -->
    <!-- set(bg_lname,null); -->
    <!-- , -->
    <!-- stopsound(scene_sound) -->
    <!-- ); -->
  <!-- 控制左侧场景切换 -->
  <!-- js(alert(get(scene[get(xml.scene)].name))) -->
  <!-- js(alert(get(currentscene))); -->
  <!-- js(alert(get(vm))); -->
  js(scrollText())  

  set(currentscene, get(xml.scene));
  <!-- set(layer[subtitles_text].y,-300 ); -->
  <!-- js(alert(vm);
  js(alert(get(currentscene))); -->
  <!-- set(scene[0].currentname, get(xml.scene))
  js(alert(get(scene[0].currentname)))
  js(vm.load_scene()) -->
 
  </action>
  <events name="tour_start" keep="true" onpreviewcomplete="js(hide_start(););" onloadcomplete=""></events>

  <events name="back_sound" keep="true"  onmousedown="playbacksound();" >/</events>
  <action name="playbacksound"> 
  <!-- js(alert(playbacksound)); -->
  if((global.backsound == false || global.backsound == null || !global.backsound) AND bksound,
    <!-- 调用自定义自动播放关闭/暂停 -->
    <!-- audioAutoPlay(); -->
    <!-- playsound(soundinterface,get(soundurl),1); -->
    <!-- 默认在界面加载时自动播放背景音乐 如果失败就手动触发 -->
    resumesound(soundinterface);
    <!-- 调用js函数进行浏览器判断 对不支持自动播放的浏览器就不执行设置global.backsound为true -->
    <!-- if(versionNum GT 66,,set(global.backsound,true);); -->
    set(global.backsound,true);
  );
  </action>
  <action name="autoPlaySceneSound" type="javascript">
  <![CDATA[
    if((krpano.get("global.isEditPage")=="1"&&typeof vm=='object')||krpano.get("global.isEditPage")=='0'){
      if(krpano.get("scene[get(xml.scene)].bksound")=='true'&&krpano.get("scene[get(xml.scene)].soundurl")){
        var currentSoundurl = krpano.get("scene_soundurl");
        var newSoundurl = krpano.get("scene[get(xml.scene)].soundurl");
        if (newSoundurl != currentSoundurl) {
          krpano.call("copy(scene_soundurl,scene[get(xml.scene)].soundurl);stopsound(scene_sound);playsound(scene_sound,get(scene_soundurl));stopsound(click_sound);set(bg_lname,null);set(currentclick, false)");  
        }
      }else{
        krpano.call("stopsound(scene_sound);");
        krpano.set("scene_soundurl", "");
      }
    }
  ]]>
   <!-- if(scene[get(xml.scene)].bksound AND scene[get(xml.scene)].soundurl,
    copy(scene_soundurl,scene[get(xml.scene)].soundurl);
    stopsound(scene_sound);>
    playsound(scene_sound,get(scene_soundurl));
    ); -->
  </action>
  <action name="initAutoPlay" type="javascript">
  <![CDATA[
    if(krpano.get("global.isEditPage")=="0"){
      <!-- console.log(krpano.get("global.isEditPage")) -->
      if(krpano.get("bksound")=='true'){
        var scene = krpano.get("xml.scene");
        var musicStr = krpano.get("musicArr");
        var musicArr = JSON.parse(musicStr)
        var i = 0;
        musicArr.forEach((item, index) => {
          var soundUrl = item.soundurl;
          var sceneArr = item.scenearr;
          if (sceneArr.indexOf(scene) != -1) {
            i++;
            if (krpano.get("soundurl") != soundUrl) {
              krpano.set("soundurl", soundUrl);
              console.log("播放背景音乐111"+soundUrl)
              krpano.call("playsound(soundinterface,get(soundurl),get(bksound_loop))");
            }
          } else {
            if (i == 0) {
              console.log("停止背景音乐"+soundUrl);
              krpano.call("stopsound(soundinterface);");
              krpano.set("soundurl", "");
            }
          }
        });
      }
    } else if (krpano.get("global.isEditPage")==1) {
      var projectid = window.location.href.split("/")[window.location.href.split("/").length-1]
      if(krpano.get("bksound")=='true'){
        var scene = krpano.get("xml.scene");
        var musicStr = krpano.get("musicArr");
        var musicArr = JSON.parse(musicStr)
        var i = 0;
        musicArr.forEach((item, index) => {
          var soundUrl = "/project/" + projectid + "/" + item.soundurl;
          var sceneArr = item.scenearr;
          if (sceneArr.indexOf(scene) != -1) {
            i++;
            if (krpano.get("soundurl") != soundUrl) {
              krpano.set("soundurl", soundUrl);
              console.log("播放背景音乐"+soundUrl)
              krpano.call("playsound(soundinterface,get(soundurl),get(bksound_loop))");
            }
          } else {
            if (i == 0) {
              console.log("停止背景音乐"+soundUrl);
              krpano.call("stopsound(soundinterface);");
              krpano.set("soundurl", "");
            }
          }
        });
      }
    }
  ]]>
  <!-- 
      var scene = krpano.get("xml.scene");
        var musicArr = krpano.get("musicArr").split(',');
        musicArr.forEach((item, index) => {
          var soundUrl = krpano.get("soundurl"+ index);
          var sceneArr = krpano.get("scenearr"+ index);
          if (sceneArr.indexOf(scene) != -1) {
            krpano.set("soundurl", soundUrl);
            console.log(krpano.get("soundurl"));
            krpano.call(`playsound(soundinterface, get(soundurl), get(bksound_loop))`)
          }
        });
  -->
  </action>
  <!-- <action name="audioAutoPlay" type="javascript">
  <![CDATA[
    var music = document.getElementById("backAudio");
            if (music.paused) { 
                music.paused=false;
                music.play(); 
            }else{
            music.pause();
}
    ]]>
  </action> -->
  <!-- <action name="bindScroll" type="javascript">
  <![CDATA[
    setInterval('$("#marquee").marquee()',2000)
    function marquee() {
      console.log( $("#marquee")[0])
      $("#marquee").marquee()
    }
  ]]></action> -->
  <!-- 滚动文字触发 -->
  <action name="subtitles_controller">
    if(layer[subtitles_text], 
      add(total,get(layer[subtitles_text].width),get(stagewidth));
      tween(layer[subtitles_text].x,get(total),get(layer[subtitles_text].timess),linear,set(layer[subtitles_text].x,0);subtitles_controller(); );
    )    
  </action>
  <!-- 停止滚动文字 -->
  <action name="stop_subtitles">
      if(layer[subtitles_text], stoptween(layer[subtitles_text].x);set(layer[subtitles_text].x,0);)
  </action>
 
  <action name="activeThumpic" type="javascript">
  <![CDATA[
    if((krpano.get("global.isEditPage")=="1"&&typeof vm=='object')||krpano.get("global.isEditPage")=='0'){
      vm.activeScene(krpano.get("xml.scene"),true);
    }
  ]]>
   <!-- if(scene[get(xml.scene)].bksound AND scene[get(xml.scene)].soundurl,
    copy(scene_soundurl,scene[get(xml.scene)].soundurl);
    stopsound(scene_sound);>
    playsound(scene_sound,get(scene_soundurl));
    ); -->
  </action>
  <!-- 动态切换热点显示不同颜色的图片 -->
        <!-- alert(krpano.get(dataurlcur)); -->
        <!-- var idArr = ["39153", "39154", "39155", "39156", "39157", "39158", "39159", "39160", "39161", "39162", "39163", "39164", "39165", "39166",
          "39167", "39168", "39169", "39170", "39171", "39172", "39173", "39174", "39175", "39176", "39177", "39178", "39179", "39180"
        ]; -->
  
  <!-- 全景视频播放 -->
  <action name="load_videopano">
    <!-- if(name!=null,plugin[name].stop());
    set(name,get(name)); -->
    <!-- js(alert(get(isvideoready));); -->
    playvideo(get(scene[get(xml.scene)]._videourl),'', get(plugin[get(name)].pausedonstart), get(plugin[get(name)].time));
  </action>
   <!-- 全景视频播放 -->
  <action name="load_video">
    <!-- if(name!=null,plugin[name].stop());
    set(name,get(name)); -->
    <!-- js(alert(666)); -->
    <!-- plugin[get(name)].playvideo(get(scene[get(xml.scene)]._videourl),'', get(plugin[get(name)].pausedonstart), get(plugin[get(name)].time)); -->
  </action>
  <!-- 触发热点监测函数 -->
  <action name="click_hotdata">
    js(getjson());
  </action>
  <!-- 创建layer弹窗警告 -->
  <action name="createWarn">
    
  </action>
  <action name="nextscene">  
    <!-- js(alert(6666)); -->
    add(newsceneindex, scene[get(xml.scene)].index, 1);  
    if(newsceneindex LT scene.count, loadscene(get(scene[get(newsceneindex)].name), null, MERGE, BLEND(0.5));); 
  </action>

  </krpano>