/***********************
* 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.bindTriggerAction(compId, symbolName, "Default Timeline", 8000, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

      

      

      

      Symbol.bindElementAction(compId, symbolName, "${_limon1}", "click", function(sym, e) {
         sym.getSymbol("limon1").$("lemon_num").html("1");

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_limon2}", "click", function(sym, e) {
         sym.getSymbol("limon2").$("lemon_num").html("2");

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_limon3}", "click", function(sym, e) {
         sym.getSymbol("limon3").$("lemon_num").html("3");

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_limon4}", "click", function(sym, e) {
         sym.getSymbol("limon4").$("lemon_num").html("4");

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_limon5}", "click", function(sym, e) {
         sym.getSymbol("limon5").$("lemon_num").html("5");

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_limon6}", "click", function(sym, e) {
         sym.getSymbol("limon6").$("lemon_num").html("6");

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_limon7}", "click", function(sym, e) {
         sym.getSymbol("limon7").$("lemon_num").html("7");

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_limon8}", "click", function(sym, e) {
         sym.getSymbol("limon8").$("lemon_num").html("8");

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_limon9}", "click", function(sym, e) {
         sym.getSymbol("limon9").$("lemon_num").html("9");

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_limon10}", "click", function(sym, e) {
         sym.getSymbol("limon10").$("lemon_num").html("10");

      });
      //Edge binding end

      

      Symbol.bindElementAction(compId, symbolName, "document", "compositionReady", function(sym, e) {
         		  transformarTexto = true; // Cambiar a false, si la actividad es de lenguaje o requiere validación exacta de las palabras   
         		  eliminarEspacios = true; // Cambiar a true, si la actividad es de matemáticas o requiere omitir los espacios en blanco de la validación
         		  //Total de inputs       
                 TotalInput = 1;
                 //Para filtrar se pueden usar las siguientes variables:
                 /* 
         		'int'= [0-9] //números enteros 
         		'num' =[0-9.]  //números y punto
         		'alphanum' =[a-z0-9_] 
         		'alpha'=[a-zA-z_ ]//caracteres mayúscula, minúscula y espacio
         		'alphalower'=[a-z_ ]  //caracteres en minúsculas y números
         		'alphaupper'=[A-Z_ ]  //caracteres en mayúscula y números
         		'alphanumupper'=[a-zA-Z0-9_]  //caracteres en minúsculas, mayúsculas y números
         		'alphanumspacelower'= [a-z0-9_ ]  //caracteres en minúsculas, números y espacio
         		'alphanumspace'= [a-z0-9_ ] //caracteres en minúsculas, espacio y números
         		'alphanumspacelower' =[a-z0-9_ ]		
         		'all'=[a-zA-Z0-9_°!"#$%&/()=?¡¨*;:_-.,}{´+¿`^[]{}@ ] //POR DEFECTO ESTÁN HABILITADOS TODOS LOS CARACTERES 
         		*/
         
                 filtrar='int';
                 sym.setVariable("border", "2px double #cccccc");
         			sym.setVariable("fondo", "rgba(255,255,255,0.50)");
         			sym.setVariable("colorini", "#666666");
         			sym.setVariable("colorok", "#666666");
         			sym.setVariable("fondook","rgba(169,194,88,0.80)");
         			sym.setVariable("colorbad", "#ffffff");
         			sym.setVariable("fondobad", "#f3716c");
         			sym.setVariable("fontsize", "64px");
         			sym.setVariable("fontFamily", "Cabin");
         			sym.setVariable("fontStyle", "normal");
         			sym.setVariable("fontweight", "bold");
         			sym.setVariable("height", "auto");
         			sym.setVariable("border-radius", "5px");
         
         //RESPUESTAS -- CAMBIAR VALORES
         sym.setVariable("Respuesta_1", "10");
         /*	
         	Modifique el valor en pixels para el ancho de cada input según lo requiera
         */
         //seleccion_1.style.textTransform="uppercase";
         //seleccion_1.style.fontStyle="italic";
         seleccion_1.style.width= largo;
         
         //seleccion_1.style.fontStyle="italic";
         

      });
      //Edge binding end

      

      

      

      

      Symbol.bindElementAction(compId, symbolName, "${_hotspot_reiniciar}", "click", function(sym, e) {
         for(var i=1; i<=10; i++){
         sym.getSymbol("limon"+i).$("lemon_num").html('');
         }

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_hotspot_solucion}", "click", function(sym, e) {
         for(var i=1; i<=10; i++){
         sym.getSymbol("limon"+i).$("lemon_num").html(i);
         }
         

      });
      //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: 'slide_1'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 18000, function(sym, e) {
         
         sym.playReverse();
         

      });
      //Edge binding end

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

   //=========================================================
   
   //Edge symbol: 'hot_spot'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 2000, function(sym, e) {
         // introducir código aquí
         sym.play();

      });
      //Edge binding end

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

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

   //=========================================================
   
   //Edge symbol: 'limon'
   (function(symbolName) {   
   
      Symbol.bindSymbolAction(compId, symbolName, "creationComplete", function(sym, e) {
         $(sym.lookupSelector("lemon_num")).html("");

      });
      //Edge binding end

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

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

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

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

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

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

   //=========================================================
   
   //Edge symbol: 'tor_caminando'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 7000, 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("loop");

      });
      //Edge binding end

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

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

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

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