/***********************
* 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, "${_bt_reiniciar}", "click", function(sym, e) {
         // introducir aquí código para clic de ratón
         // Ir a una etiqueta o a un momento específicos y parar. Por ejemplo:
         // sym.stop(500); o sym.stop("miEtiqueta");
         sym.getSymbol("coconut5").stop("ini");
         sym.getSymbol("coconut1").stop("ini");
         sym.getSymbol("coconut2").stop("ini");
         sym.getSymbol("coconut3").stop("ini");
         sym.getSymbol("coconut4").stop("ini");
         
         // Mostrar un elemento 
         sym.$("num_1").show();
         sym.$("num_2").show();
         sym.$("num_3").show();
         sym.$("num_4").show();
         sym.$("num_5").show();
         
         Stage_TextOpt1.style.color= 'rgba(255,199,0,1.00)';
         Stage_TextOpt2.style.color= 'rgba(255,199,0,1.00)';
         Stage_TextOpt3.style.color= 'rgba(255,199,0,1.00)';
         Stage_TextOpt4.style.color= 'rgba(255,199,0,1.00)';
         Stage_TextOpt5.style.color= 'rgba(255,199,0,1.00)';

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_num_5}", "click", function(sym, e) {
         sym.getSymbol("coconut5").play();
         Stage_TextOpt5.style.color= '#f3716c';
         sym.$("error")[0].play();
         sym.$("num_5").hide();
         
         

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_num_4}", "click", function(sym, e) {
         sym.getSymbol("coconut1").play();
         Stage_TextOpt4.style.color= '#f3716c';
         sym.$("error")[0].play();
         sym.$("num_4").hide();

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_num_3}", "click", function(sym, e) {
         sym.getSymbol("coconut2").play();
         Stage_TextOpt2.style.color= '#f3716c';
         //Stage_TextOpt3.style.size= '50px';
         sym.$("success")[0].play();
         sym.$("num_3").hide();
         

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_num_2}", "click", function(sym, e) {
         sym.getSymbol("coconut3").play();
         Stage_TextOpt2.style.color= '#ffffff';
         sym.$("error")[0].play();
         sym.$("num_2").hide();
         sym.$("num_1").hide();
         sym.$("num_2").hide();
         sym.$("num_3").hide();
         sym.$("num_4").hide();
         sym.$("num_5").hide();

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_num_1}", "click", function(sym, e) {
         sym.getSymbol("coconut4").play();
         // Ocultar un elemento 
         //sym.$("TextOpt1").hide();
         //TextOpt1.style.font-size= '50px';
         Stage_TextOpt1.style.color= '#f3716c';
         //sym.$("success")[0].play();
         sym.$("error")[0].play();
         //sym.$("Audio02")[0].play();
         // Ocultar un elemento 
         sym.$("num_1").hide();
         

      });
      //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: 'Bg'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1500, function(sym, e) {
         sym.getSymbol("volcano").play();

      });
      //Edge binding end

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

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

   //=========================================================
   
   //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: 'bt_ayuda'
   (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_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) {
         //elimina el mute del audio
         	sym.getComposition().getStage().$(soundId)[0].muted = false;
         	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'

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