/***********************
* 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: '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.play();

      });
      //Edge binding end

      

      

      

      

      

      

      

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1000, function(sym, e) {
         sym.stop();
sym.getSymbol("cursiva").play("inicio");
sym.getSymbol("bt_cursiva").stop("down");
sym.$("cursiva").show();
// Ocultar un elemento 
sym.$("script").hide();

      });
      //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: 'bt_cursiva'
   (function(symbolName) {   
   
      Symbol.bindElementAction(compId, symbolName, "${_RectangleCopy}", "click", function(sym, e) {
         sym.stop("down");
         sym.getComposition().getStage().getSymbol("slide_1").getSymbol("bt_Script").stop("up");
         sym.getComposition().getStage().getSymbol("slide_1").$("cursiva").show();
         sym.getComposition().getStage().getSymbol("slide_1").getSymbol("cursiva").play("inicio");
         sym.getComposition().getStage().getSymbol("slide_1").$("script").hide();
         sym.$("RectangleCopy").hide();
         sym.$("RectangleCopy3").show();
         
         sym.getComposition().getStage().getSymbol("slide_1").$("ba").hide();
         sym.getComposition().getStage().getSymbol("slide_1").$("be").hide();
         sym.getComposition().getStage().getSymbol("slide_1").$("bi").hide();
         sym.getComposition().getStage().getSymbol("slide_1").$("bo").hide();
         sym.getComposition().getStage().getSymbol("slide_1").$("bu").hide();

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "${_RectangleCopy3}", "click", function(sym, e) {
         sym.stop("up");
         sym.getComposition().getStage().getSymbol("slide_1").getSymbol("bt_Script").stop("up");
         
         // Ocultar un elemento 
         sym.getComposition().getStage().getSymbol("slide_1").$("script").hide();
         sym.getComposition().getStage().getSymbol("slide_1").$("cursiva").hide();
         sym.getComposition().getStage().getSymbol("slide_1").$("script").stop("inicio");
         sym.getComposition().getStage().getSymbol("slide_1").$("cursiva").stop("inicio");
         sym.$("RectangleCopy").show();
         sym.$("RectangleCopy3").hide();
         
         // Ocultar un elemento 
         sym.getComposition().getStage().getSymbol("slide_1").$("ba").hide();
         sym.getComposition().getStage().getSymbol("slide_1").$("be").hide();
         sym.getComposition().getStage().getSymbol("slide_1").$("bi").hide();
         sym.getComposition().getStage().getSymbol("slide_1").$("bo").hide();
         sym.getComposition().getStage().getSymbol("slide_1").$("bu").hide();
         
         // Ocultar un elemento 
         sym.getComposition().getStage().getSymbol("slide_1").$("cursiva").hide();
         

      });
      //Edge binding end

      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_cursiva");
   //Edge symbol end:'bt_cursiva'

   //=========================================================
   
   //Edge symbol: 'bt_Script'
   (function(symbolName) {   
   
      Symbol.bindElementAction(compId, symbolName, "${_Rectangle}", "click", function(sym, e) {
         sym.stop("down");
         sym.getComposition().getStage().getSymbol("slide_1").getSymbol("bt_cursiva").stop("up");
         sym.getComposition().getStage().getSymbol("slide_1").$("script").show();
         sym.getComposition().getStage().getSymbol("slide_1").getSymbol("script").play("ini");
         sym.$("Rectangle2").show();
         sym.getComposition().getStage().getSymbol("slide_1").$("cursiva").hide();
         sym.$("Rectangle").hide();
         
         sym.getComposition().getStage().getSymbol("slide_1").$("ba").hide();
         sym.getComposition().getStage().getSymbol("slide_1").$("be").hide();
         sym.getComposition().getStage().getSymbol("slide_1").$("bi").hide();
         sym.getComposition().getStage().getSymbol("slide_1").$("bo").hide();
         sym.getComposition().getStage().getSymbol("slide_1").$("bu").hide();

      });
      //Edge binding end

      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

      Symbol.bindElementAction(compId, symbolName, "${_Rectangle2}", "click", function(sym, e) {
         sym.stop("up");
         sym.getComposition().getStage().getSymbol("slide_1").getSymbol("bt_cursiva").stop("up");
         // Ocultar un elemento 
         sym.getComposition().getStage().getSymbol("slide_1").$("script").hide();
         sym.getComposition().getStage().getSymbol("slide_1").$("cursiva").hide();
         
         sym.getComposition().getStage().getSymbol("slide_1").$("script").stop("inicio");
         sym.getComposition().getStage().getSymbol("slide_1").$("cursiva").stop("inicio");
         
         sym.$("Rectangle").show();
         sym.$("Rectangle2").hide();
         
         // Ocultar un elemento 
         sym.getComposition().getStage().getSymbol("slide_1").$("ba").hide();
         sym.getComposition().getStage().getSymbol("slide_1").$("be").hide();
         sym.getComposition().getStage().getSymbol("slide_1").$("bi").hide();
         sym.getComposition().getStage().getSymbol("slide_1").$("bo").hide();
         sym.getComposition().getStage().getSymbol("slide_1").$("bu").hide();
         
         // Ocultar un elemento 
         sym.getComposition().getStage().getSymbol("slide_1").$("script").hide();
         

      });
      //Edge binding end

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

   //=========================================================
   
   //Edge symbol: 'bt_audio'
   (function(symbolName) {   
   
      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.stop("down");
         
         } else {
         //activar para pausar en vez de reiniciar
         	sym.getComposition().getStage().$(soundId)[0].pause();
         	sym.stop("up");
         }

      });
      //Edge binding end

      Symbol.bindSymbolAction(compId, symbolName, "creationComplete", function(sym, e) {
         /*var soundId = sym.getSymbolElement().attr( "title" );
         var playing = false;
         $(soundId).bind("playing", function() {
            playing = true;
         // disable button/link
         });
         $(soundId).bind("ended", function() {
            playing = false;
         // enable button/link
         });
         
         // Mostrar un elemento 
         sym.$("ht_spot").bind("click", function() {
         if(!playing) {
         // Reproducir una pista de audio según el title de accesibilidad de este simbolo
         sym.getComposition().getStage().$(soundId)[0].play();
         sym.stop("down");
         }else{
         sym.getComposition().getStage().$(soundId)[0].currentTime = 0;
         sym.stop(0);
         }
         });*/
         
         

      });
      //Edge binding end

      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) {
         sym.stop();

      });
      //Edge binding end

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

   //=========================================================
   
   //Edge symbol: 'cursiva'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 4000, function(sym, e) {
         sym.stop();
         //sym.getComposition().getStage().getSymbol("slide_2").getSymbol("C1").play("audios");
         
         sym.getComposition().getStage().getSymbol("slide_1").$("ba").show();
         sym.getComposition().getStage().getSymbol("slide_1").$("be").show();
         sym.getComposition().getStage().getSymbol("slide_1").$("bi").show();
         sym.getComposition().getStage().getSymbol("slide_1").$("bo").show();
         sym.getComposition().getStage().getSymbol("slide_1").$("bu").show();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

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

   //=========================================================
   
   //Edge symbol: 'script'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 4000, function(sym, e) {
         sym.stop();
         //sym.getComposition().getStage().getSymbol("slide_2").getSymbol("C1").play("audios");
         
         sym.getComposition().getStage().getSymbol("slide_1").$("ba").show();
         sym.getComposition().getStage().getSymbol("slide_1").$("be").show();
         sym.getComposition().getStage().getSymbol("slide_1").$("bi").show();
         sym.getComposition().getStage().getSymbol("slide_1").$("bo").show();
         sym.getComposition().getStage().getSymbol("slide_1").$("bu").show();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

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

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