/***********************
* Acciones de composición de Adobe Edge Animate
*
* Editar este archivo con precaución, teniendo cuidado de conservar 
* las firmas de función y los comentarios que comienzan con "Edge" para mantener la 
* capacidad de interactuar con estas acciones en Adobe Edge Animate
*
***********************/
(function($, Edge, compId){
var Composition = Edge.Composition, Symbol = Edge.Symbol; // los alias más comunes para las clases de Edge

   //Edge symbol: 'stage'
   (function(symbolName) {
      
      
      

      

      

      

      

      

      

      

      

      

      

      

      Symbol.bindElementAction(compId, symbolName, "${_hotspot_1}", "click", function(sym, e) {
         sym.$("hotspot_1").hide();
         sym.getSymbol("scena").playReverse(500);
         sym.getSymbol("gym_girl").stop(1);
         sym.getSymbol("scaner").play(1);
         sym.$("hotspot_2").show();
         sym.$("hotspot_3").show();
         sym.$("hotspot_4").show();
         sym.$("hotspot_5").show();
         sym.$("hotspot_6").show();
         sym.$("hotspot_7").show();
         sym.$("hotspot_volver").show();
         sym.$("bt_audio_1").hide();
         sym.$("bt_audio_2").hide();
         sym.$("bt_audio_3").hide();

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_hotspot_2}", "click", function(sym, e) {
         sym.getSymbol("pop_1").play(1);
         sym.getSymbol("pop_2").stop(0);
         sym.getSymbol("pop_3").stop(0);
         sym.getSymbol("pop_4").stop(0);
         sym.getSymbol("pop_5").stop(0);
         sym.getSymbol("pop_6").stop(0);

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_hotspot_3}", "click", function(sym, e) {
         sym.getSymbol("pop_2").play(1);
         sym.getSymbol("pop_1").stop(0);
         sym.getSymbol("pop_3").stop(0);
         sym.getSymbol("pop_4").stop(0);
         sym.getSymbol("pop_5").stop(0);
         sym.getSymbol("pop_6").stop(0);
         

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_hotspot_4}", "click", function(sym, e) {
         sym.getSymbol("pop_3").play(1);
         sym.getSymbol("pop_1").stop(0);
         sym.getSymbol("pop_2").stop(0);
         sym.getSymbol("pop_4").stop(0);
         sym.getSymbol("pop_5").stop(0);
         sym.getSymbol("pop_6").stop(0);

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_hotspot_5}", "click", function(sym, e) {
         sym.getSymbol("pop_4").play(1);
         sym.getSymbol("pop_1").stop(0);
         sym.getSymbol("pop_2").stop(0);
         sym.getSymbol("pop_3").stop(0);
         sym.getSymbol("pop_5").stop(0);
         sym.getSymbol("pop_6").stop(0);

      });
      //Edge binding end

      

      

      Symbol.bindElementAction(compId, symbolName, "${_hotspot_volver}", "click", function(sym, e) {
         sym.getSymbol("scaner").playReverse(500);
         sym.getSymbol("scena").play();
         sym.$("hotspot_1").show();
         sym.$("hotspot_volver").hide();
         sym.$("hotspot_2").hide();
         sym.$("hotspot_3").hide();
         sym.$("hotspot_4").hide();
         sym.$("hotspot_5").hide();
         sym.$("hotspot_6").hide();
         sym.$("hotspot_7").hide();
         sym.getSymbol("pop_1").stop(0);
         sym.getSymbol("pop_2").stop(0);
         sym.getSymbol("pop_3").stop(0);
         sym.getSymbol("pop_4").stop(0);
         sym.getSymbol("pop_5").stop(0);
         sym.getSymbol("pop_6").stop(0);
         sym.getSymbol("gym_girl").play(1);
         sym.$("bt_audio_1").show();
         sym.$("bt_audio_2").show();
         sym.$("bt_audio_3").show();

      });
      //Edge binding end

      

   })("stage");
   //Edge symbol end:'stage'

   //=========================================================
   
   //Edge symbol: 'Precargador'
   (function(symbolName) {   
   
   })("Precargador");
   //Edge symbol end:'Precargador'

   //=========================================================
   
   //Edge symbol: 'bt_ayuda_1'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 250, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

   })("bt_ayuda");
   //Edge symbol end:'bt_ayuda'

   //=========================================================
   
   //Edge symbol: 'bt_reiniciar'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 250, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

   })("bt_reiniciar");
   //Edge symbol end:'bt_reiniciar'

   //=========================================================
   
   //Edge symbol: 'explorer_pizza'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         sym.play();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 5250, function(sym, e) {
         sym.playReverse();

      });
      //Edge binding end

   })("explorer_pizza");
   //Edge symbol end:'explorer_pizza'

   //=========================================================
   
   //Edge symbol: 'head_explorer'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         sym.play();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 7500, function(sym, e) {
         sym.playReverse();

      });
      //Edge binding end

   })("head_explorer");
   //Edge symbol end:'head_explorer'

   //=========================================================
   
   //Edge symbol: 'brillo_1'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         sym.play();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 500, function(sym, e) {
         sym.playReverse();

      });
      //Edge binding end

   })("brillo_1");
   //Edge symbol end:'brillo_1'

   //=========================================================
   
   //Edge symbol: 'pop_1'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         sym.stop();

      });
      //Edge binding end

   })("pop_1");
   //Edge symbol end:'pop_1'

   //=========================================================
   
   //Edge symbol: 'pop_2'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         sym.stop();

      });
      //Edge binding end

   })("pop_2");
   //Edge symbol end:'pop_2'

   //=========================================================
   
   //Edge symbol: 'pop_3'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         sym.stop();

      });
      //Edge binding end

   })("pop_3");
   //Edge symbol end:'pop_3'

   //=========================================================
   
   //Edge symbol: 'pop_4'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         sym.stop();

      });
      //Edge binding end

   })("pop_4");
   //Edge symbol end:'pop_4'

   //=========================================================
   
   //Edge symbol: 'pop_5'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         sym.stop();

      });
      //Edge binding end

   })("pop_5");
   //Edge symbol end:'pop_5'

   //=========================================================
   
   //Edge symbol: 'pop_6'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         sym.stop();

      });
      //Edge binding end

   })("pop_6");
   //Edge symbol end:'pop_6'

   //=========================================================
   
   //Edge symbol: 'scena'
   (function(symbolName) {   
   
   })("scena");
   //Edge symbol end:'scena'

   //=========================================================
   
   //Edge symbol: 'scaner'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         sym.stop();

      });
      //Edge binding end

   })("scaner");
   //Edge symbol end:'scaner'

   //=========================================================
   
   //Edge symbol: 'brillos'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         sym.play();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2500, function(sym, e) {
         sym.play(1);

      });
      //Edge binding end

   })("brillos");
   //Edge symbol end:'brillos'

   //=========================================================
   
   //Edge symbol: 'brillo_volver'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         sym.play();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1500, function(sym, e) {
         sym.playReverse();

      });
      //Edge binding end

   })("brillo_volver");
   //Edge symbol end:'brillo_volver'

   //=========================================================
   
   //Edge symbol: 'volver'
   (function(symbolName) {   
   
   })("volver");
   //Edge symbol end:'volver'

   //=========================================================

   //=========================================================

   //=========================================================

   //=========================================================

   //=========================================================
   
   //Edge symbol: 'bt_audio'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_ht_spot}", "click", function(sym, e) {
         var soundId = sym.getSymbolElement().attr( "title" );
         var currentAudio=sym.getComposition().getStage().$(soundId)[0].currentTime;
         var duracion= sym.getComposition().getStage().$(soundId).duration;
         console.log("soundId="+soundId);
         if (duracion== currentAudio){
         sym.stop("up");
         }
         
         sym.getComposition().getStage().$(soundId).on('ended', function() {
         sym.stop("up");
         });
         console.log("currentAudio="+currentAudio);
         console.log("duracion="+duracion); 
         
         $("audio").prop("muted", true);
         
         	if (sym.getComposition().getStage().$(soundId)[0].paused) {
         	//elimina el mute del audio
         	sym.getComposition().getStage().$(soundId)[0].muted = false;
         	sym.getComposition().getStage().$(soundId)[0].volume=0.7;
         	sym.getComposition().getStage().$(soundId)[0].play();
         	sym.stop("down");
         
         } else {
         //activar para pausar en vez de reiniciar
         	sym.getComposition().getStage().$(soundId)[0].pause();
         	sym.stop("up");
         }

      });
      //Edge binding end

      

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 250, function(sym, e) {
         sym.stop();

      });
      //Edge binding end

      

   })("bt_audio");
   //Edge symbol end:'bt_audio'

})(jQuery, AdobeEdge, "EDGE-1010687340");