/***********************
* 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", 1900, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

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

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_bt_audio_1}", "click", function(sym, e) {
         sym.play(4000);
         

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1600, function(sym, e) {
         
         sym.getSymbol("boy").getSymbol("headBoy").getSymbol("mouth2").play(1000);

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         sym.getSymbol("Girl").getSymbol("girl_head").getSymbol("girl_mouth").stop(400);

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_next_a}", "click", function(sym, e) {
         
         sym.play(2000);
         sym.getSymbol("boy").getSymbol("headBoy").getSymbol("mouth2").stop(0);
         
         sym.getSymbol("Girl").getSymbol("girl_head").getSymbol("girl_mouth").play(1000);
         
         
         

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_next_b}", "click", function(sym, e) {
         // introducir aquí código para clic de ratón
         sym.play(4000);
         sym.getSymbol("Girl").getSymbol("girl_head").getSymbol("girl_mouth").stop(200);
         sym.getSymbol("boy").getSymbol("headBoy").getSymbol("mouth2").play(1000);
         
         

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_next_a2}", "click", function(sym, e) {
         // introducir aquí código para clic de ratón
         sym.play(6000);
         
         sym.getSymbol("Girl").getSymbol("girl_head").getSymbol("girl_mouth").play(1000);
         sym.getSymbol("boy").getSymbol("headBoy").getSymbol("mouth2").stop(0);
         
         

      });
      //Edge binding end

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

      });
      //Edge binding end

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

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_next_b2}", "click", function(sym, e) {
         // introducir aquí código para clic de ratón
         sym.play(8000);
         sym.getSymbol("Girl").getSymbol("girl_head").getSymbol("girl_mouth").stop(0);
         sym.getSymbol("boy").getSymbol("headBoy").getSymbol("mouth2").play(1000);
         
         
         

      });
      //Edge binding end

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

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_next_a3}", "click", function(sym, e) {
         sym.play(10000);
         sym.getSymbol("boy").getSymbol("headBoy").getSymbol("mouth2").stop(0);
         
         sym.getSymbol("Girl").getSymbol("girl_head").getSymbol("girl_mouth").play(1000);
         
         
         sym.$("Text6").html("Sí, se llama <span><b>“¿Cómo preparar leche achocolatada?”</b></span>, pero a veces no da suficiente información.");
         $("span").css("color","rgba(160,17,39,1.00)");
         

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 11900, function(sym, e) {
         sym.stop();
         sym.getSymbol("Girl").getSymbol("girl_head").getSymbol("girl_mouth").stop(0);
         sym.getSymbol("boy").getSymbol("headBoy").getSymbol("mouth2").play(1000);

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_next_b3}", "click", function(sym, e) {
         
         sym.play(12000);
         sym.getSymbol("Girl").getSymbol("girl_head").getSymbol("girl_mouth").stop(0);
         sym.getSymbol("boy").getSymbol("headBoy").getSymbol("mouth2").play(1000);

      });
      //Edge binding end

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

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_next_a4}", "click", function(sym, e) {
         sym.play(14000);
         sym.getSymbol("Girl").getSymbol("girl_head").getSymbol("girl_mouth").play(1000);
         sym.getSymbol("boy").getSymbol("headBoy").getSymbol("mouth2").stop(0);

      });
      //Edge binding end

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

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_next_b5}", "click", function(sym, e) {
         sym.play(16000);
         

      });
      //Edge binding end

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

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_next_a6}", "click", function(sym, e) {
         sym.play(18000);
         sym.getSymbol("Girl").getSymbol("girl_head").getSymbol("girl_mouth").play(1000);
         sym.getSymbol("boy").getSymbol("headBoy").getSymbol("mouth2").stop(0);

      });
      //Edge binding end

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

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_next_b6}", "click", function(sym, e) {
         sym.play(20000);
         sym.getSymbol("Girl").getSymbol("girl_head").getSymbol("girl_mouth").stop(0);
         sym.getSymbol("boy").getSymbol("headBoy").getSymbol("mouth2").play(1000);

      });
      //Edge binding end

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

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_next_a7}", "click", function(sym, e) {
         sym.play(22000);
         sym.getSymbol("Girl").getSymbol("girl_head").getSymbol("girl_mouth").play(1000);
         sym.getSymbol("boy").getSymbol("headBoy").getSymbol("mouth2").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: 'Symbol_1'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 3800, function(sym, e) {
         
         sym.play(0);

      });
      //Edge binding end

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

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

      });
      //Edge binding end

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

      });
      //Edge binding end

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

      });
      //Edge binding end

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

      });
      //Edge binding end

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

      });
      //Edge binding end

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

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

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

   //=========================================================
   
   //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'

   //=========================================================
   
   //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.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

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
         //Edge binding end

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

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

      });
         //Edge binding end

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

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