/***********************
* Adobe Edge Animate Composition Actions
*
* Edit this file with caution, being careful to preserve 
* function signatures and comments starting with 'Edge' to maintain the 
* ability to interact with these actions from within Adobe Edge Animate
*
***********************/
(function($, Edge, compId){
var Composition = Edge.Composition, Symbol = Edge.Symbol; // aliases for commonly used Edge classes

   //Edge symbol: 'stage'
   (function(symbolName) {
      
      
      

      

      

      

      

      

      

      

      

      Symbol.bindSymbolAction(compId, symbolName, "creationComplete", function(sym, e) {
         // insert code to be run when the symbol is created here
         yepnope({
             load: [
         		"js/energize.js"
         	],
         	complete: function () {
         
              console.log("allscript complete");
              sym.play();
           }
         });

      });
      //Edge binding end

      Symbol.bindElementAction(compId, symbolName, "document", "compositionReady", function(sym, e) {
         // insert code to be run when the composition is fully loaded here
         
         var tempBtn;
         
         for(var i =1;i<=4;i++){
         	sym.$("btn_"+i).bind("click",function(){
         		console.log(this.id);
         		playBtn(this);
         	});
         }
         
         function playBtn(currentBtn){
         
         	sym.getSymbol(currentBtn).play("active");
         
         	if(!tempBtn){
         		tempBtn = true;
         		tempBtn = currentBtn;
         	}else{
         		if(currentBtn == tempBtn){
         			sym.getSymbol(currentBtn).play("active");
         		}else{
         			sym.getSymbol(tempBtn).stop(0);
         			tempBtn = currentBtn;
         		}
         		
         	}
         
         
         }
         var assa = sym.$("btn_1");
         playBtn(assa);

      });
      //Edge binding end

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

   //=========================================================
   
   //Edge symbol: 'btn_1'
   (function(symbolName) {   
   
      

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

   //=========================================================
   
   //Edge symbol: 'btn_2'
   (function(symbolName) {   
   
      

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

   //=========================================================
   
   //Edge symbol: 'btn_3'
   (function(symbolName) {   
   
      

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

   //=========================================================
   
   //Edge symbol: 'btn_4'
   (function(symbolName) {   
   
      

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

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