/***********************
* 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) {
      
      
      

      

      

      

      

      

      

      

      

      

      

      

      

      

      

      

   })("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().getSymbol("escena_3").$(soundId)[0].currentTime;
         var duracion= sym.getComposition().getStage().getSymbol("escena_3").$(soundId).duration;
         console.log("soundId="+soundId);
         if (duracion== currentAudio){
         sym.stop("up");
         }
         
         sym.getComposition().getStage().getSymbol("escena_3").$(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().getSymbol("escena_3").$(soundId)[0].paused) {
         	sym.getComposition().getStage().getSymbol("escena_3").$(soundId)[0].play();
         	sym.getComposition().getStage().getSymbol("escena_3").$(soundId)[0].volume=0.7;
         	sym.stop("down");
         
         } else {
         //activar para pausar en vez de reiniciar
         	sym.getComposition().getStage().getSymbol("escena_3").$(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: 'escena_1'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2660, function(sym, e) {
         sym.stop();

      });
      //Edge binding end

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

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 5455, function(sym, e) {
         // introducir código aquí
         sym.getComposition().getStage().getSymbol("escena_2").play(1);
         
         // Ocultar un elemento 
         sym.getComposition().getStage().$("escena_1").fadeOut("slow");
         

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

      });
      //Edge binding end

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

   //=========================================================
   
   //Edge symbol: 'escena_2'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 8320, function(sym, e) {
         
         // introducir código aquí
         sym.getComposition().getStage().getSymbol("escena_3").play(1);
         
         // Ocultar un elemento 
         sym.getComposition().getStage().$("escena_2").fadeOut("slow");

      });
      //Edge binding end

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

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_A2_opcion}", "click", function(sym, e) {
         sym.getComposition().getStage().$("error")[0].play();
         
         // Mostrar un elemento 
         sym.$("msj_incorrecto").show();
         sym.getSymbol("msj_incorrecto").play(1);
         
         

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_A3_opcion}", "click", function(sym, e) {
         sym.getComposition().getStage().$("error")[0].play();
         
         // Mostrar un elemento 
         sym.$("msj_incorrecto").show();
         sym.getSymbol("msj_incorrecto").play(1);

      });
      //Edge binding end

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

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_A1_opcion}", "click", function(sym, e) {
         sym.getComposition().getStage().$("success")[0].play();
         sym.play("seguir_2");
         // Mostrar un elemento 
         sym.$("check").show();
         sym.getSymbol("check").play(1);
         

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_B3_opcion}", "click", function(sym, e) {
         sym.getComposition().getStage().$("success")[0].play();
         sym.play("seguir_3");
         // Mostrar un elemento 
         sym.$("check").show();
         sym.getSymbol("check").play(1);
         

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_B2_opcion}", "click", function(sym, e) {
         sym.getComposition().getStage().$("error")[0].play();
         
         // Mostrar un elemento 
         sym.$("msj_incorrecto").show();
         sym.getSymbol("msj_incorrecto").play(1);

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_B1_opcion}", "click", function(sym, e) {
         sym.getComposition().getStage().$("error")[0].play();
         
         // Mostrar un elemento 
         sym.$("msj_incorrecto").show();
         sym.getSymbol("msj_incorrecto").play(1);

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 5760, function(sym, e) {
         // introducir código aquí
         sym.getComposition().getStage().getSymbol("escena_4").play(1);
         
         // Ocultar un elemento 
         sym.getComposition().getStage().$("escena_3").fadeOut("slow");

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 8320, function(sym, e) {
         
         // introducir código aquí
         sym.getComposition().getStage().getSymbol("escena_5").play(1);
         
         // Ocultar un elemento 
         sym.getComposition().getStage().$("escena_4").fadeOut("slow");

      });
      //Edge binding end

      

      

      

      Symbol.bindElementAction(compId, symbolName, "${_C3_opcion}", "click", function(sym, e) {
         sym.getComposition().getStage().$("success")[0].play();
         sym.play("seguir_2");
         
         // Mostrar un elemento 
         sym.$("check").show();
         sym.getSymbol("check").play(1);
         
         

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_C2_opcion}", "click", function(sym, e) {
         sym.getComposition().getStage().$("error")[0].play();
         
         // Mostrar un elemento 
         sym.$("msj_incorrecto").show();
         sym.getSymbol("msj_incorrecto").play(1);
         

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_C1_opcion}", "click", function(sym, e) {
         sym.getComposition().getStage().$("error")[0].play();
         
         // Mostrar un elemento 
         sym.$("msj_incorrecto").show();
         sym.getSymbol("msj_incorrecto").play(1);

      });
      //Edge binding end

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

      });
      //Edge binding end

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

   //=========================================================
   
   //Edge symbol: 'fireflyes'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 690, function(sym, e) {
         sym.playReverse();

      });
      //Edge binding end

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

      });
      //Edge binding end

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

      });
      //Edge binding end

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

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

      });
         //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 8320, function(sym, e) {
         
         // introducir código aquí
         sym.getComposition().getStage().getSymbol("escena_5").play(1);
         
         // Ocultar un elemento 
         sym.getComposition().getStage().$("escena_4").fadeOut("slow");

      });
         //Edge binding end

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

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_button_Day}", "click", function(sym, e) {
         // introducir aquí código para clic de ratón
         // Mostrar un elemento 
         sym.$("Background_Day").fadeIn("slow");
         
         // Ocultar un elemento 
         sym.$("Background_Night").fadeOut("slow");
         
         // Ocultar un elemento 
         sym.$("grass_gray").fadeOut("slow");

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_button_Night}", "click", function(sym, e) {
         sym.$("Background_Night").fadeIn("slow");
         
         // Ocultar un elemento 
         sym.$("Background_Day").fadeOut("slow");
         
         
         // Ocultar un elemento 
         sym.$("grass_gray").fadeOut("slow");
         

      });
      //Edge binding end

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

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