/***********************
* 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.$("pop_1").show();
         sym.getSymbol("pop_1").play(1);
         sym.$("pop_2").fadeOut("slow");
         sym.$("pop_3").fadeOut("slow");
         sym.$("pop_4").fadeOut("slow");
         sym.$("handmouse_1").fadeOut("slow");
         sym.$("handmouse_2").show();
         sym.$("handmouse_3").show();
         sym.$("handmouse_4").show();
         sym.$("brillo_1").fadeOut("slow");
         sym.$("bt_1").fadeOut("slow");
         sym.$("bt_2").show();
         sym.$("bt_3").show();
         sym.$("bt_4").show();
         sym.$("hotspot_1").hide();
         sym.$("hotspot_2").show();
         sym.$("hotspot_3").show();
         sym.$("hotspot_4").show();

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_hotspot_2}", "click", function(sym, e) {
         sym.$("pop_2").show();
         sym.getSymbol("pop_2").play(1);
         sym.$("pop_1").fadeOut("slow");
         sym.$("pop_3").fadeOut("slow");
         sym.$("pop_4").fadeOut("slow");
         sym.$("handmouse_2").fadeOut("slow");
         sym.$("handmouse_1").show();
         sym.$("handmouse_3").show();
         sym.$("handmouse_4").show();
         sym.$("brillo_2").fadeOut("slow");
         sym.$("bt_2").fadeOut("slow");
         sym.$("bt_1").show();
         sym.$("bt_3").show();
         sym.$("bt_4").show();
         sym.$("hotspot_2").hide();
         sym.$("hotspot_1").show();
         sym.$("hotspot_3").show();
         sym.$("hotspot_4").show();

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_hotspot_3}", "click", function(sym, e) {
         sym.$("pop_3").show();
         sym.getSymbol("pop_3").play(1);
         sym.$("pop_1").fadeOut("slow");
         sym.$("pop_2").fadeOut("slow");
         sym.$("pop_4").fadeOut("slow");
         sym.$("handmouse_3").fadeOut("slow");
         sym.$("handmouse_1").show();
         sym.$("handmouse_2").show();
         sym.$("handmouse_4").show();
         sym.$("brillo_3").fadeOut("slow");
         sym.$("bt_3").fadeOut("slow");
         sym.$("bt_1").show();
         sym.$("bt_2").show();
         sym.$("bt_4").show();
         sym.$("hotspot_3").hide();
         sym.$("hotspot_2").show();
         sym.$("hotspot_1").show();
         sym.$("hotspot_4").show();

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_hotspot_4}", "click", function(sym, e) {
         sym.$("pop_4").show();
         sym.getSymbol("pop_4").play(1);
         sym.$("pop_1").fadeOut("slow");
         sym.$("pop_2").fadeOut("slow");
         sym.$("pop_3").fadeOut("slow");
         sym.$("handmouse_4").fadeOut("slow");
         sym.$("handmouse_1").show();
         sym.$("handmouse_2").show();
         sym.$("handmouse_3").show();
         sym.$("brillo_4").fadeOut("slow");
         sym.$("bt_4").fadeOut("slow");
         sym.$("bt_1").show();
         sym.$("bt_3").show();
         sym.$("bt_2").show();
         sym.$("hotspot_4").hide();
         sym.$("hotspot_2").show();
         sym.$("hotspot_3").show();
         sym.$("hotspot_1").show();

      });
      //Edge binding end

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

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

   //=========================================================
   
   //Edge symbol: 'flecha_bt'
   (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

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

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

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

   //=========================================================
   
   //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");
            // enable button/link
         });
         
         console.log("currentAudio="+currentAudio);
         console.log("duracion="+duracion);
         // Definir un conmutador para reproducir o pausar una pista de audio 
         if (sym.getComposition().getStage().$(soundId)[0].paused) {
         	sym.getComposition().getStage().$(soundId)[0].play();
         	sym.getComposition().getStage().$(soundId)[0].volume=0.7;
         	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: 'NINA_ejercicio'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 20000, function(sym, e) {
         sym.play(0);

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

      });
      //Edge binding end

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

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

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

      });
      //Edge binding end

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

      });
      //Edge binding end

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

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

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

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

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

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

   //=========================================================
   
   //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: 'brillo_2'
   (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_2");
   //Edge symbol end:'brillo_2'

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

   //=========================================================
   
   //Edge symbol: 'pop_1'
   (function(symbolName) {   
   
      Symbol.bindSymbolAction(compId, symbolName, "creationComplete", function(sym, e) {
         sym.$("Text1").css("overflow-y","scroll");
         sym.$("Text1").css("overflow-x","hidden");

      });
      //Edge binding end

      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

      Symbol.bindSymbolAction(compId, symbolName, "creationComplete", function(sym, e) {
         sym.$("Text1").css("overflow-y","scroll");
         sym.$("Text1").css("overflow-x","hidden");

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

      Symbol.bindSymbolAction(compId, symbolName, "creationComplete", function(sym, e) {
         sym.$("Text1").css("overflow-y","scroll");
         sym.$("Text1").css("overflow-x","hidden");

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

      Symbol.bindSymbolAction(compId, symbolName, "creationComplete", function(sym, e) {
         sym.$("Text1").css("overflow-y","scroll");
         sym.$("Text1").css("overflow-x","hidden");

      });
      //Edge binding end

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

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