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

   })("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: 'animacion'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 6295, function(sym, e) {
         sym.stop();

      });
      //Edge binding end

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

      });
      //Edge binding end

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

      });
      //Edge binding end

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

      });
      //Edge binding end

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

      });
      //Edge binding end

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

      });
      //Edge binding end

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

      });
      //Edge binding end

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

      });
      //Edge binding end

      Symbol.bindSymbolAction(compId, symbolName, "creationComplete", function(sym, e) {
         //////////////////////////////
         
         //botones
         /*sym.getSymbol("bt_validar").stop("normal");
         sym.getSymbol("bt_solucion").stop("down");
         sym.getSymbol("bt_reiniciar").stop("down");
         sym.getSymbol("bt_ayuda").stop("normal");
         sym.$("hotspot_validar").show();
         sym.$("hotspot_solucion").hide();
         sym.$("hotspot_reiniciar").hide();
         sym.$("hotspot_ayuda").show();
         */
         
         sym.$("TextArea_01").html("<input type='text' id='tal'>")
         
         //TEXTAREA02//
         sym.$("TextArea_02").html("<input type='text' id='tal2'>")
         
         //TEXTAREA03//
         sym.$("TextArea_03").html("<input type='text' id='tal3'>")	 
         
         //TEXTAREA04//
         sym.$("TextArea_04").html("<input type='text' id='tal4'>")	 
         
         
         sym.$("TA_05").append(document.createElement("TextArea"));
         $('input[type=text], textarea').css({
         	width:'599px',
         	height:'266px',
         	border:'solid 1px #787878',
         	background:'#FFFFFF',
         	fontSize:'20px',
         	lineHeight:'40px',
         	textAlign:'left',
         	margin:'5px',
         	fontFamily:'Cabin',
         	fontStyle:'normal',
         	color:'normal',
         	fontStyle:'#666666'
         });
         $("textarea").css("height","266px");
         $("textarea").css("width","599px");
         
         $("#tal").css("width","259px");
         $("#tal").css("height","30px");
         $("#tal2").css("width","259px");
         $("#tal2").css("height","30px");
         $("#tal3").css("width","599px");
         $("#tal3").css("height","26px");
         $("#tal4").css("width","599px");
         $("#tal4").css("height","26px");
         $("input").css("fontSize","18px");

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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