/***********************
* 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().$(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: 'background'
   (function(symbolName) {   
   
      

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

      });
      //Edge binding end

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

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

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