/***********************
* 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.bindSymbolAction(compId, symbolName, "creationComplete", function(sym, e) {
         sym.$('.center-wrapper').css("overflow","hidden");

      });
      //Edge binding end

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

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2000, function(sym, e) {
         //sym.$("Symbol_23").hide();
         
         sym.$("descripcion").hide();
         sym.$("descripcion").html("Julio debe ir arriba del círculo. Da clic en Julio");
         sym.$("descripcion").fadeIn("slow");

      });
      //Edge binding end

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

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 4500, function(sym, e) {
         sym.getSymbol("Julio").stop(0);
         sym.stop();
         

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_HotspotJulio}", "click", function(sym, e) {
         sym.play();
         sym.getSymbol("Julio").play(0); 
         sym.$("HotspotJulio").hide();
         
         

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 4100, function(sym, e) {
         
         sym.$("descripcion").hide();
         sym.$("descripcion").html("Juan y Felipe estarán abajo del punto de referencia. Da clic en Juan y Felipe");
         sym.$("descripcion").fadeIn("slow");

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_hotspotPoint}", "click", function(sym, e) {
         sym.play(1801);
         sym.$("hotspotPoint").hide();
         

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_hotspotJuan}", "click", function(sym, e) {
         
         sym.play();
         
         sym.getSymbol("Juan").play(1);
         sym.getSymbol("felipe").play(1);
         
         sym.$("hotspotJuan").hide();
         sym.$("hotspotFelipe").hide();
         
         

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_hotspotFelipe}", "click", function(sym, e) {
         sym.play();
         
         sym.getSymbol("Juan").play(1);
         sym.getSymbol("felipe").play(1);
         
         sym.$("hotspotJuan").hide();
         sym.$("hotspotFelipe").hide();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 6635, function(sym, e) {
         sym.getSymbol("felipe").stop(0);
         sym.getSymbol("Juan").stop(0);

      });
      //Edge binding end

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

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

   //=========================================================
   
   //Edge symbol: 'bt_next'
   (function(symbolName) {   
   
      

      

      

      

      

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         // introducir código aquí
      });
      //Edge binding end

      

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

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

      });
      //Edge binding end

      

      

      

      

      

      

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

   //=========================================================
   
   //Edge symbol: 'slide_5'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         //CAMBIAR ESTA OPCIÓN A PLAY SI SE DESEA INICIAR LA ANIMACIÓN O SI ES IMAGEN FIJA PONERLA EN STOP 
         sym.stop();

      });
      //Edge binding end

      

      

      

      

      

      

      

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

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

      });
      //Edge binding end

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

      });
      //Edge binding end

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

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

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

   //=========================================================
   
   //Edge symbol: 'boca_nina'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 4390, function(sym, e) {
         // introducir código aquí
         // Reproducir la línea de tiempo en un momento o etiqueta específicos. Por ejemplo:
         // sym.play(500); o sym.play("myLabel");
         sym.play("inicio");

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

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

   //=========================================================
   
   //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.getComposition().getStage().getSymbol("Girl").getSymbol("head").getSymbol("boca_lipsync").stop();
         sym.stop("up");
         }
         
         sym.getComposition().getStage().$(soundId).on('ended', function() {
         sym.getComposition().getStage().getSymbol("Girl").getSymbol("head").getSymbol("boca_lipsync").stop();
         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");
         	sym.getComposition().getStage().getSymbol("Girl").getSymbol("head").getSymbol("boca_lipsync").play();
         
         } else {
         //activar para pausar en vez de reiniciar
         	sym.getComposition().getStage().$(soundId)[0].pause();
         	sym.stop("up");
         	sym.getComposition().getStage().getSymbol("Girl").getSymbol("head").getSymbol("boca_lipsync").stop();
         }

      });
      //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'

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

      });
      //Edge binding end

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

   //=========================================================
   
   //Edge symbol: 'bt_audio_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) {
         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.getComposition().getStage().getSymbol("Girl").getSymbol("head").getSymbol("boca_lipsync").stop();
         sym.stop("up");
         }
         
         sym.getComposition().getStage().$(soundId).on('ended', function() {
         sym.getComposition().getStage().getSymbol("Girl").getSymbol("head").getSymbol("boca_lipsync").stop();
         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");
         
         	sym.getComposition().getStage().getSymbol("Girl").getSymbol("head").getSymbol("boca_lipsync").play();
         
         
         } else {
         //activar para pausar en vez de reiniciar
         	sym.getComposition().getStage().$(soundId)[0].pause();
         	sym.stop("up");
         	sym.getComposition().getStage().getSymbol("Girl").getSymbol("head").getSymbol("boca_lipsync").stop();
         }

      });
         //Edge binding end

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

   //=========================================================
   
   //Edge symbol: 'bt_audio_2'
   (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) {
         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().getSymbol("Girl").getSymbol("head").getSymbol("boca_lipsync").stop();
         }
         
         sym.getComposition().getStage().$(soundId).on('ended', function() {
         sym.getComposition().getStage().getSymbol("Girl").getSymbol("head").getSymbol("boca_lipsync").stop();
         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");
         	sym.getComposition().getStage().getSymbol("Girl").getSymbol("head").getSymbol("boca_lipsync").play();
         
         } else {
         //activar para pausar en vez de reiniciar
         	sym.getComposition().getStage().$(soundId)[0].pause();
         	sym.stop("up");
         	sym.getComposition().getStage().getSymbol("Girl").getSymbol("head").getSymbol("boca_lipsync").stop();
         }

      });
         //Edge binding end

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

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